Difference between revisions of "Template:IPA/doc"

From blackwiki
Jump to navigation Jump to search
imported>GermanJoe
(+ TD header, structure)
imported>Nardog
m (Reverted 1 edit by 203.189.116.185 (talk) to last revision by Andrybak)
 
(24 intermediate revisions by 18 users not shown)
Line 1: Line 1:
 
{{documentation subpage}}
 
{{documentation subpage}}
{{transwiki guide}}
+
{{TOC right}}
<!--
+
 
    PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE
 
-->
 
 
=== Usage ===
 
=== Usage ===
'''[[Template:IPA]]''' is most useful when there are multiple instances of the [[International Phonetic Alphabet]] (IPA) on a page. It contains
+
'''[[Template:IPA]]''' is 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>
  
This means, it simply specifies a class called “IPA” as a hook for CSS styling and DOM scripting.
+
This means it specifies a class called "IPA" as a hook for CSS styling and DOM scripting. This allows for assigning specific fonts to display IPA characters. Registered Wikipedia users can specify their own fonts for IPA text by editing their user style sheet, e.g. [[Special:MyPage/common.css]]. Users can also edit their global stylesheet ([[meta:Special:MyPage/global.css]]), which works across all 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. For instance, the following code would cause IPA to be displayed in the font [[Charis SIL]]:
 
+
<syntaxhighlight lang="css">
This allows fixing broken display of IPA characters in MS Internet Explorer 6 for Windows, and choice of style in any browser.
+
.IPA {
 
+
font-family: Charis SIL;
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.
+
}</syntaxhighlight>
 
 
[[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.
 
  
 
=== TemplateData ===
 
=== TemplateData ===
{{TemplateDataHeader}}
+
{{TemplateData header}}
 
<templatedata>{
 
<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.",
 
"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.",
Line 40: Line 36:
 
  <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 appear in your browser as:
+
Which appears in your browser as:
  
 
: {{IPA|/ˈkærəktɚz/}}
 
: {{IPA|/ˈkærəktɚz/}}
Line 50: Line 46:
 
: /[[character|ˈkærəktɚz]]/
 
: /[[character|ˈ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.]
+
These sets may look different if you have a custom font 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 the template, 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 ===
 
The following is a list of fonts that are used using this template.
 
* [[Lucida Sans Unicode]]
 
* [[Arial Unicode MS]]
 
  
 
{{usage of IPA templates}}
 
{{usage of IPA templates}}
<includeonly>
+
<includeonly>{{Sandbox other||
 
<!-- PLEASE ADD CATEGORIES BELOW THIS LINE, THANKS. -->
 
<!-- PLEASE ADD CATEGORIES BELOW THIS LINE, THANKS. -->
[[Category:IPA templates|*]]
+
[[Category:IPA templates| ]]
 
+
[[Category:Character templates]]
 
<!-- PLEASE ADD INTERWIKIS BELOW THIS LINE, THANKS. -->
 
<!-- PLEASE ADD INTERWIKIS BELOW THIS LINE, THANKS. -->
</includeonly>
+
}}</includeonly>
 
 
<includeonly>
 
[[es:Plantilla:IPA]]
 
</includeonly>
 

Latest revision as of 10:02, 14 November 2020

Usage

Template:IPA is 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 specifies a class called "IPA" as a hook for CSS styling and DOM scripting. This allows for assigning specific fonts to display IPA characters. Registered Wikipedia users can specify their own fonts for IPA text by editing their user style sheet, e.g. Special:MyPage/common.css. Users can also edit their global stylesheet (meta:Special:MyPage/global.css), which works across all 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. For instance, the following code would cause IPA to be displayed in the font Charis SIL:

.IPA {
	font-family: Charis SIL;
}

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for IPA

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

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 appears 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 may look different if you have a custom font defined for IPA text.

Please place all IPA text into the template, 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.

Template:Usage of IPA templates