Difference between revisions of "Template:IPA/doc"

From blackwiki
Jump to navigation Jump to search
imported>Iowajason
(Add link to transwiki guide)
imported>Crissov
(<templatedata>, links inside {{IPA}})
Line 4: Line 4:
 
     PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE
 
     PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE
 
-->
 
-->
=== Usage ===
+
== Usage ==
 +
<templatedata>{
 +
"description": "This template ensures proper display of transcriptions using the International Phonetic Alphabet (IPA), especially in older operating systems and browsers. There are related specialized templates that also semi-automatically generate the transcription itself.",
 +
"params": {
 +
  "1": {
 +
    "label": "transcription",
 +
    "description": "including square brackets […] for phonetic transcriptions or enclosing forward slashes /…/ for phonemic ones",
 +
    "type": "string",
 +
    "required": true
 +
  }
 +
}}</templatedata>
  
'''[[Template:IPA]]''' is most useful when there are multiple instances of the IPA on a page. It contains
+
'''[[Template:IPA]]''' is most useful when there are multiple instances of the [[International Phonetic Alphabet]] (IPA) on a page. It contains
  
<nowiki><span title="Representation in the International Phonetic Alphabet (IPA)" class="IPA">{{{1}}}</span></nowiki>
+
<nowiki><span title="Representation in the International Phonetic Alphabet (IPA)" class="IPA">{{{1}}}</span></nowiki>
  
I.e., it simply specifies CSS class IPA.
+
This means, it simply specifies a class called “IPA” as a hook for CSS styling and DOM scripting.
  
This allows fixing broken display of [[International Phonetic Alphabet]] (IPA) characters in MS Internet Explorer 6 for Windows, and choice of style in any browser.  
+
This allows fixing broken display of IPA characters in MS Internet Explorer 6 for Windows, and choice of style in any browser.  
  
 
The font declaration is in [[MediaWiki:Common.js]] and targets ''only'' Windows XP. Registered Wikipedia users can specify their own style for IPA text by editing, for each project, their user style sheet, e.g. monobook.css. Users can also specify the style locally in their browser, which works across projects.
 
The font declaration is in [[MediaWiki:Common.js]] and targets ''only'' Windows XP. Registered Wikipedia users can specify their own style for IPA text by editing, for each project, their user style sheet, e.g. monobook.css. Users can also specify the style locally in their browser, which works across projects.
  
=== Examples ===
+
[[MediaWiki:Common.css]] also ensures that links inside IPA transcriptions marked up with this template do not use underlines since these carry special semantics there.
 +
 
 +
== Examples ==
  
 
Placing a phonemic rendering of the word ''characters'' in Template:IPA:
 
Placing a phonemic rendering of the word ''characters'' in Template:IPA:
  
 
  <nowiki>{{IPA|/ˈkærəktɚz/}}</nowiki>
 
  <nowiki>{{IPA|/ˈkærəktɚz/}}</nowiki>
 +
<nowiki>{{IPA|/ˈ[[character|kærəktɚz]]/}}</nowiki>
  
 
The result will be a span with a class attribute, like this:
 
The result will be a span with a class attribute, like this:
Line 26: Line 39:
 
  <nowiki><span</nowiki> title="Representation in the International Phonetic Alphabet (IPA)" class="IPA">/ˈkærəktɚz/<nowiki></span></nowiki>
 
  <nowiki><span</nowiki> title="Representation in the International Phonetic Alphabet (IPA)" class="IPA">/ˈkærəktɚz/<nowiki></span></nowiki>
  
Which appears in your browser as:
+
Which appear in your browser as:
  
 
: {{IPA|/ˈkærəktɚz/}}
 
: {{IPA|/ˈkærəktɚz/}}
 +
: {{IPA|/[[character|ˈkærəktɚz]]/}}
  
 
Without template:IPA:
 
Without template:IPA:
  
 
: /ˈkærəktɚz/
 
: /ˈkærəktɚz/
 +
: /[[character|ˈkærəktɚz]]/
  
[The last two should only look different if you are using Internet Explorer 6 or lower on Windows, or if you have a custom style defined for IPA text.]
+
[These sets should only look different if you are using Internet Explorer 6 or lower on Windows, or if you have a custom style defined for IPA text.]
  
 
Please place all IPA text into Template:IPA, even if it doesn't have any special IPA characters, like this: {{IPA |/mi/}}.  This will allow users to format all examples of IPA text consistently, with their choice of fonts, colours, etc.
 
Please place all IPA text into Template:IPA, even if it doesn't have any special IPA characters, like this: {{IPA |/mi/}}.  This will allow users to format all examples of IPA text consistently, with their choice of fonts, colours, etc.
  
=== List of fonts ===
+
== List of fonts ==
 
The following is a list of fonts that are used using this template.
 
The following is a list of fonts that are used using this template.
 
*[[Lucida Sans Unicode]]
 
*[[Lucida Sans Unicode]]

Revision as of 20:27, 1 July 2013

Usage

This template ensures proper display of transcriptions using the International Phonetic Alphabet (IPA), especially in older operating systems and browsers. There are related specialized templates that also semi-automatically generate the transcription itself.

Template parameters

ParameterDescriptionTypeStatus
transcription1

including square brackets […] for phonetic transcriptions or enclosing forward slashes /…/ for phonemic ones

Stringrequired

Template:IPA is most useful when there are multiple instances of the International Phonetic Alphabet (IPA) on a page. It contains

<span title="Representation in the International Phonetic Alphabet (IPA)" class="IPA">{{{1}}}</span>

This means, it simply specifies a class called “IPA” as a hook for CSS styling and DOM scripting.

This allows fixing broken display of IPA characters in MS Internet Explorer 6 for Windows, and choice of style in any browser.

The font declaration is in MediaWiki:Common.js and targets only Windows XP. Registered Wikipedia users can specify their own style for IPA text by editing, for each project, their user style sheet, e.g. monobook.css. Users can also specify the style locally in their browser, which works across projects.

MediaWiki:Common.css also ensures that links inside IPA transcriptions marked up with this template do not use underlines since these carry special semantics there.

Examples

Placing a phonemic rendering of the word characters in Template:IPA:

{{IPA|/ˈkærəktɚz/}}
{{IPA|/ˈ[[character|kærəktɚz]]/}}

The result will be a span with a class attribute, like this:

<span title="Representation in the International Phonetic Alphabet (IPA)" class="IPA">/ˈkærəktɚz/</span>

Which appear in your browser as:

/ˈkærəktɚz/
/ˈkærəktɚz/

Without template:IPA:

/ˈkærəktɚz/
/ˈkærəktɚz/

[These sets should only look different if you are using Internet Explorer 6 or lower on Windows, or if you have a custom style defined for IPA text.]

Please place all IPA text into Template:IPA, even if it doesn't have any special IPA characters, like this: /mi/. This will allow users to format all examples of IPA text consistently, with their choice of fonts, colours, etc.

List of fonts

The following is a list of fonts that are used using this template.

Template:Usage of IPA templates