Template:Em/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>SMcCandlish
→‎Good example: An Engrish signfiy confusing in word-make.
meta>SMcCandlish
rewrite, to conform with updates to Template:Strong/doc
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
== Purpose ==
This template make it faster and easier to apply &#91;[[XHTML|X]]&#93;[[HTML]]'s <code><nowiki><em>...</em></nowiki></code> {{em|emphasis}} markup to text, and more importantly to indicate to human and bot editors they should not use <code><nowiki>''...''</nowiki></code> or <code><nowiki><i>...</i></nowiki></code> typographic italicization to replace the intentional and semantically meaningful <code><nowiki><em></nowiki></code>.  Strong emphasis is usually rendered visually in an italic (oblique a.k.a. slanted) typeface by default on graphical browsers, but can be parsed and acted upon in customizable ways with style sheets, apps and text-to-speech screen readers. It is said to be [[semantic markup]], i.e. markup that conveys meaning or context, not just visual appearance. Simple italicizing is purely typographic and is semantically meaningless. It is most often used for titles publications (books, films, albums, etc.), foreign words and phrases, [[words as words]] (when quotation marks are not used for that purpose), names of ships, [[Binomial nomenclature|scientific names of organisms]] and other cases where stylistic conventions demand italics, but they convey no sense of emphasis.  The average reader, and average editor, do not and need not care about this distinction most of the time, but it can be important and editors who understand it can use this template as a baseline insurance against accidental or careless replacement by bots and human editors.


== Usage ==
== Usage ==
Line 6: Line 9:
:{{tlnull|em|<var>text to be emphasized</var>}}
:{{tlnull|em|<var>text to be emphasized</var>}}


or
or, if the text to be emphasized contains an equals sign:


:{{tlnull|em|'''1{{=}}'''<var>text to be emphasized if it contains an equals sign</var>}}
:{{tlnull|em|'''1{{=}}'''<var>text to be emphasized</var>}}


These both render as:
These both render as:
Line 14: Line 17:
:{{em|text to be emphasized}}
:{{em|text to be emphasized}}


This template puts intentional and explicit <code><nowiki><em>...</em></nowiki></code> (emphasis) markup around the text provided as the first parameter. It is safest to always use the {{para|1}} syntax.
This template puts intentional and explicit <code><nowiki><em>...</em></nowiki></code> (emphasis) [X]HTML markup around the text provided as the first parameter. It is safest to always use the {{para|1}} syntax.


=== Good example ===
===Optional parameters===
Advanced HTML values can be passed through the template to the HTML code:
*{{para|class}} takes a class name (or multiple class names, separated by commas); adds <code>class="<var>classname[s]</var>"</code> to the HTML code
*{{para|style}} takes inline CSS input; addes <code>style="<var>CSS directive[s]</var>"</code> to the HTML code
*{{para|lang}} takes ISO language codes in one or two part form (e.g. <code>fr</code> or <code>fr-CA</code>); adds <code>lang="<var>language-code</var>" xml:lang="<var>language-code</var>"</code> to the HTML code. Generally only used for foreign language material (e.g. in a quotation). Do not use for English unless the material enclosed in this markup is extremely dialectal, and the dialect has an ISO code (do not try to make up codes).
*{{para|id}} takes a valid, unique HTML id (must begin with an alphabetic letter); adds <code>id="<var>name</var>"</code> to the HTML code


This template is made to [[emphasis|emphasize]] keywords. Example:
=== Use cases===
*"Emphasis signifies a context difference only {{em|while}} the text is being read." This example should use <code><nowiki>{{em|while}}</nowiki></code>.
{{more|Wikipedia:WikiProject Usability/Scannability}}
This template is made to [[Emphasis|mildly emphasize]] an important word or phrase in a passage, in a way that is (unlike simply italicizing it) [[Semantic markup|semantically meaningful markup]]. With this technique, the emphasized text stands out from the rest of the nearby text in most if not all visual browsers and some text-to-speech screen readers (which usually ignore purely typographic italicization), without strongly affecting scannability. It can also be parsed by user agents and other software as definitively indicating emphasis, not just some typographic boldface effect for appearance's sake. It should therefore only be used sparingly in articles, to highlight something being stressed (e.g., to represent strong vocal emphasis). Example:


=== When this template should not be used ===
*"<code><nowiki>Contrary to reports, she was {{em|not}} dead after all.</nowiki></code>"<br />"Contrary to reports, she was {{em|not}} dead after all."


But careful, {{t|Em}} is strictly for emphasis. It should not be used for layout, typography conventions, books and such. In these different cases, italics <code><nowiki>''...''</nowiki></code> or <code><nowiki><i>...</i></nowiki></code> should be used instead:
It is also occasionally used for disambiguation, e.g. between two adjacent but different uses of the same word or homonym ("What is {{em|is}} is a kind of custard.), but this usage is not often encyclopedic and can (when not found in a direct quotation) usually be rewritten to avoid the awkward construction.
*"''The New York Times'' is an American daily newspaper." This example should use <code><nowiki>''The New York Times''</nowiki></code>.


=== Purpose ===
== When this template should not be used ==


The purpose of this template is to make it faster and easier to apply HTML "emphasis" style to text, and more importantly to completely prevent bad-behaving bots from replacing intentionally and semantically meaningful <code>&lt;em&gt;</code> (which is usually rendered visually in an italic typeface by default on graphical browsers, but can be parsed and acted upon in customizable ways with style sheets, apps and text-to-speech screen readers) with purely typographic and semantically meaningless simple italicization (as used for book titles, etc.) in either <code>&lt;i&gt;</code> or <code><nowiki>''</nowiki></code> formatThe average user, and average editor, do not and need not care about this distinction most of the time, but the distinction can be important and editors who understand it can use this template as a baseline insurance against accidental or careless replacement by bots (or humans for that matter).
Because {{tnull|em}} is strictly for semantic (meaningful) emphasis, it should not be used for layout, typography conventions (titles, foreign words, etc.), and other cases that are not true emphasis. In these different cases, italic <code><nowiki>'''...'''</nowiki></code> (which resolves to <code><nowiki><i>...</i></nowiki></code> in the user agent) should be used insteadIt should also not be used when the text to which it is applied is already italicized for some other reason (e.g., it is part of a book title); in such cases use {{tlx|strong}} instead.  Usually avoid using {{tnull|em}} in non-quoted sentences that end in an exclamation point. And it is usually excessive to use it on terms that are already wikilinked, since the link markup acts as a form of emphasis itself.


===Optional parameters===
But careful, {{t|Em}} is strictly for emphasis. It should not be used for layout, typography conventions, books and such. In these different cases, italics <code><nowiki>''...''</nowiki></code> or <code><nowiki><i>...</i></nowiki></code> should be used instead:
Advanced HTML values can be passed through the template to the HTML code:
*"''The New York Times'' is an American daily newspaper." This example should use <code><nowiki>''The New York Times''</nowiki></code>.
*{{para|class}} takes a class name (or multiple class names, separated by commas); adds <code>class="<var>classname[s]</var>"</code> to the HTML code
*{{para|style}} takes inline CSS input; addes <code>style="<var>CSS directive[s]</var>"</code> to the HTML code
*{{para|lang}} takes ISO language codes in one or two part form (e.g. <code>fr</code> or <code>fr-CA</code>); adds <code>lang="<var>language-code</var>" xml:lang="<var>language-code</var>"</code> to the HTML code. Generally only used for foreign language material (e.g. in a quotation). Do not use for English unless the material enclosed in this markup is extremely dialectal, and the dialect has an ISO code (do not try to make up codes).
*{{para|id}} takes a valid, unique HTML id (must begin with an alphabetic letter); adds <code>id="<var>name</var>"</code> to the HTML code


== See also ==
== See also ==
*{{tlx|strong}} - same thing but for preventing <code>&lt;strong&gt;</code> markup being changed into <code>&lt;b&gt;</code> or <code><nowiki>'''</nowiki></code>
*{{tlx|strong}} - similar template for preventing <code><nowiki><strong></nowiki></code> ({{strong|strongemphasis}}) markup being changed into <code><nowiki>'''</nowiki></code> or <code><nowiki><b></nowiki></code> boldface


<includeonly>
<includeonly>

Revision as of 07:45, 19 June 2011

Purpose

This template make it faster and easier to apply [X]HTML's <em>...</em> emphasis markup to text, and more importantly to indicate to human and bot editors they should not use ''...'' or <i>...</i> typographic italicization to replace the intentional and semantically meaningful <em>. Strong emphasis is usually rendered visually in an italic (oblique a.k.a. slanted) typeface by default on graphical browsers, but can be parsed and acted upon in customizable ways with style sheets, apps and text-to-speech screen readers. It is said to be semantic markup, i.e. markup that conveys meaning or context, not just visual appearance. Simple italicizing is purely typographic and is semantically meaningless. It is most often used for titles publications (books, films, albums, etc.), foreign words and phrases, words as words (when quotation marks are not used for that purpose), names of ships, scientific names of organisms and other cases where stylistic conventions demand italics, but they convey no sense of emphasis. The average reader, and average editor, do not and need not care about this distinction most of the time, but it can be important and editors who understand it can use this template as a baseline insurance against accidental or careless replacement by bots and human editors.

Usage

Template:Tlnull

or, if the text to be emphasized contains an equals sign:

Template:Tlnull

These both render as:

text to be emphasized

This template puts intentional and explicit <em>...</em> (emphasis) [X]HTML markup around the text provided as the first parameter. It is safest to always use the |1= syntax.

Optional parameters

Advanced HTML values can be passed through the template to the HTML code:

  • |class= takes a class name (or multiple class names, separated by commas); adds class="classname[s]" to the HTML code
  • |style= takes inline CSS input; addes style="CSS directive[s]" to the HTML code
  • |lang= takes ISO language codes in one or two part form (e.g. fr or fr-CA); adds lang="language-code" xml:lang="language-code" to the HTML code. Generally only used for foreign language material (e.g. in a quotation). Do not use for English unless the material enclosed in this markup is extremely dialectal, and the dialect has an ISO code (do not try to make up codes).
  • |id= takes a valid, unique HTML id (must begin with an alphabetic letter); adds id="name" to the HTML code

Use cases

Template:More This template is made to mildly emphasize an important word or phrase in a passage, in a way that is (unlike simply italicizing it) semantically meaningful markup. With this technique, the emphasized text stands out from the rest of the nearby text in most if not all visual browsers and some text-to-speech screen readers (which usually ignore purely typographic italicization), without strongly affecting scannability. It can also be parsed by user agents and other software as definitively indicating emphasis, not just some typographic boldface effect for appearance's sake. It should therefore only be used sparingly in articles, to highlight something being stressed (e.g., to represent strong vocal emphasis). Example:

  • "Contrary to reports, she was {{em|not}} dead after all."
    "Contrary to reports, she was not dead after all."

It is also occasionally used for disambiguation, e.g. between two adjacent but different uses of the same word or homonym ("What is is is a kind of custard.), but this usage is not often encyclopedic and can (when not found in a direct quotation) usually be rewritten to avoid the awkward construction.

When this template should not be used

Because {{em}} is strictly for semantic (meaningful) emphasis, it should not be used for layout, typography conventions (titles, foreign words, etc.), and other cases that are not true emphasis. In these different cases, italic '''...''' (which resolves to <i>...</i> in the user agent) should be used instead. It should also not be used when the text to which it is applied is already italicized for some other reason (e.g., it is part of a book title); in such cases use {{strong}} instead. Usually avoid using {{em}} in non-quoted sentences that end in an exclamation point. And it is usually excessive to use it on terms that are already wikilinked, since the link markup acts as a form of emphasis itself.

But careful, {{Em}} is strictly for emphasis. It should not be used for layout, typography conventions, books and such. In these different cases, italics ''...'' or <i>...</i> should be used instead:

  • "The New York Times is an American daily newspaper." This example should use ''The New York Times''.

See also

  • {{strong}} - similar template for preventing <strong> (strongemphasis) markup being changed into ''' or <b> boldface