Template:Deprecated code/doc: Difference between revisions

Content deleted Content added
m remove {{DEFAULTSORT:{{PAGENAME}}}}
<dcs> redirects to <dc2>. Hence, results are identical and this example is not needed.
 
(23 intermediate revisions by 8 users not shown)
Line 1:
{{Documentation subpage|[[Template:Deprecated code]] ([[Template:Dc]]), [[Template:Deprecated code red]] and [[Template:Deprecated code 2]] ([[Template:Dc2]])}}
{{Template shortcut|dc}}
<!-- Categories and interwikis go at the bottom of this page. -->
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
 
== Usage ==
The {{tlx|deprecated code}} template (easiest used from its '''{{tltlx|dc}}''' redirect) can be used to indicate, e.g. in template documentation or Wikipedia articles on things like HTML specifications, code that has been [[Deprecation|deprecated]] and should not normally be used. It can also be used to indicate other deleted or deprecated material. On the technical level it is a CSS-styled {{tag|del}} that greys out the text (the near-universal sign in computing and computing documentation for "doesn't work", "don't do this", "bad code", "ignore", "option not available", etc.), and removes that element's usual strikethrough (CSS: "line-through") rendering, which makes the content hard to read. If you really want that line-through, use the '''{{tltlx|dc2}}''' (AKA '''{{tlx|dcs}}''') variant {{dc2|to do this}}; it is otherwise identical.
 
{{strong|Note: This template does not apply a monospaced font.}} This is so that it can be used inside an existing code (or non-code) block and inherit its font style. If necessary, wrap the template in one of {{tag|code}} (source code), {{tag|kbd}} (example input), or {{tag|samp}} (example output) as [[Semantic HTML|semantically]] appropriate. If you want monospace without semantic markup like {{tag|code|o}}, you can use the alternative templates {{tlx|mxtd}}: {{mxtd}}, or {{tlx|!mxt}}: {{!mxt}}.
 
===Parameters===
*{{para|1}} &nbsp; the content to be marked as deprecated
*{{para|2}} or {{para|title}} a mouse-over "tooltip" (in some browsers, anyway), e.g. for briefly explaining the deprecation, e.g. "Deprecated since HTML 3.0" or "Breaks infobox formatting"
*{{para|red|y}} &nbsp; make the text red instead of grey, for indicating dangerous/error/forbidden things (a shortcut for this is '''{{tlx|dcr}}''')
*{{para|class}} &nbsp; assign a CSS class
*{{para|id}} &nbsp; assign an HTML ID for #linking and other purposes (must be unique on the page and start with an alphabetic letter)
*{{para|style}} &nbsp; add additional CSS styling (can be used to add <{{code|lang=css|code>=text-decoration:line-through;</code>}} back in if you want that formatting; a shortcut for this is '''{{tlx|dc2}}''' or '''{{tlx|dcs}}''')
 
===Examples===
*<code><nowiki>{{dc|deprecated}}</nowiki></code> yields: {{dc|deprecated}}
*<code><nowiki>{{dc|red=ydcr|deprecated}}</nowiki></code> yields: {{dc|red=ydcr|deprecated}}
*<code><nowiki>{{dc2|deprecated}}</nowiki></code> yields: {{dc2|deprecated}}
 
== See also ==
* {{tltlx|xtd}} (and [[Template:Xt /see also|related templates]]) for indicating deprecated (and, good, bad, and neutral) examples in guidelines, how-tos, and template documentation.
** {{tlx|mxtd}} in this template group ({{mxtd|example output here}}) is an alternative to {{tlx|dc}}.
** {{tlx|!mxt}} in this template group ({{!mxt|example output here}}) is an alternative to {{tlx|dcr}}.
* {{tlx|strongbad}} – for introducing something as deprecated or issuing some other warning in documentation, e.g.: {{tlx|strongbad|Not for use in mainspace.}}
 
;Core semantic{{Semantic markup templates:}}
{{Semantic templates see also}}
 
<includeonly>{{Sandbox other||
<!-- Categories andbelow this line; interwikis goat here:Wikidata -->
[[Category:Programming typing-aid templates]]
[[Category:Semantic markup templates]]
[[Category:Text color templates]]
}}</includeonly>
[[Category:Programming typing-aid templates]]
</includeonly>