Difference between revisions of "Template:IPA soundbox/doc"

From blackwiki
Jump to navigation Jump to search
imported>Bgeron
m (Fix displayed syntax for example)
imported>Vanisaac
m (→‎See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other)
 
(10 intermediate revisions by 2 users not shown)
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 -->
{{Intricate template}}
+
This template produces a standard box to start a sound file. It has some extra features to help linking to a phonetic sound file. When the audio file is not specified, the file based on the symbol will be fetched from [[Module:IPA symbol/data]]. Basic examples:
This template produces a standard box to start a sound file. It has some extra features to help linking to a phonetic sound file. Also, there are options to format possible error messages and to alter the layout of the box. Basic examples:
 
 
* {{tlx|IPA soundbox|ə}} → {{IPA soundbox|ə}}
 
* {{tlx|IPA soundbox|ə}} → {{IPA soundbox|ə}}
* {{tlx|IPA soundbox|<nowiki>χ|</nowiki>Voiceless_uvular_fricative.ogg}} → {{IPA soundbox|χ|Voiceless_uvular_fricative.ogg}}
+
* {{tlx|IPA soundbox|<nowiki>χ|</nowiki>Voiceless uvular fricative.ogg}} → {{IPA soundbox|χ|Voiceless uvular fricative.ogg}}
  
=== Usage ===
+
===Input options===
The box is created in three steps:<br>
+
* {{para|label}}: content above the soundbox (the symbol with link if empty)
'''Step 1'''. Determine the soundfile name
+
* {{para|size|250px}}: width of the entire template
:- By using input IPA symbol, looked up in a list: {{code|ipa symbol{{=}}p}} &rarr; {{IPA soundbox|p|checkexist=no|showbox=no}}
+
* {{para|font-size|120%}}: font size of the IPA symbol
:- Use input soundfile: {{code|soundfile{{=}}bilabial click.ogg}}&rarr; {{IPA soundbox|ʘ|soundfile=bilabial click.ogg|checkexist=no}}
+
* {{para|line-height|1.5}}: line height of the IPA symbol
 +
* {{para|hidecc|yes}}: hides the CC (closed captions) button
  
'''Step 2'''. Check if the soundfile exists
+
If the audio file doesn't exist, the symbol will still be shown but the template will categorize the page into [[:Category:IPA pages with non-existing IPA audio soundfile]].
This check may prevent red links and (undesired) repeated checks
 
  
'''Step 3'''. Create the standard browser soundbox on the page, using [[WP:EIS|<nowiki>[[File:soundfile]]</nowiki>]]
+
=== See also ===
Here the information is put together, optional settings such as size are used, and the result is soundbox.
+
* {{tlx|IPA soundbox/cell}} (wrapper template for table cells)
* {{tlx|IPA soundbox|p||size{{=}}60px}} →
 
* {{IPA soundbox|p||size=60px}}
 
 
 
====Input options====
 
:a. {{para|checkexist|no}}: skip (expensive) check on file existence. Default=yes (do the check).
 
:b. layout of the soundbox (these settings use basic layout parameters):
 
:-  {{para|showicon|no}}: show info icon ("noicon" in basic)
 
:- {{para|size|50px}} size (in px: default =250px, minimum is ~40px) Basic: width.
 
:- {{para|style}}: any style (CSS format) to be used, e.g. {{para|style|background:yellow;}}
 
* {{tlx|IPA soundbox|<nowiki>| ipa symbol=m| size=120px| style=border:1px solid red; background:yellow;</nowiki>}} →
 
{{IPA soundbox| ipa symbol=m| size=120px| style=border:1px solid red; background:yellow;}}
 
<br/>
 
:c. When an error would exist, show an error message:
 
:- default: show errormessage as <span class="error">error message</span>
 
:- {{para|errortext|something is wrong}}: Show alternate text when error
 
:- {{para|errortext}}: blank, no output at all (no showbox)
 
 
 
Example of check file once:
 
*See {{tl|infobox IPA}}. First the file is checked, and returns filename if exists. ''Then'' if there is a filename, the infobox row is composed, including the soundbox set with {{para|checkexist|no}}.
 
 
 
;Full parameter list:
 
<pre>
 
{{IPA soundbox
 
<!-- GENERAL -->
 
| ipa symbol    =
 
| style        =
 
| errortext    =
 
<!-- ABOVE -->
 
| show box above=
 
| showsymbol    =
 
| line-height  =
 
<!-- PLAYER -->
 
| soundfile    =
 
| checkexist    =
 
| showicon      =
 
| width        =
 
| size          =
 
}}</pre>
 
  
;Possible errors:
 
:1. IPA symbol unknown in IPAsym list
 
:2. File does not exist
 
:When an error exists, no button will be shown.
 
 
=== See also ===
 
* {{tlx|IPA audio filename}}
 
* {{tlx|infobox IPA}} (uses this template internally)
 
* {{tlx|IPA vowels audio}} (uses this template internally)
 
* {{tlx|IPA pulmonics audio}} (uses this template internally)
 
* [[Wikipedia:Extended image syntax]]
 
 
{{IPA templates}}
 
{{IPA templates}}
  
<includeonly>
+
<includeonly>{{Sandbox other||
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
  
 
[[Category:IPA audio templates]]
 
[[Category:IPA audio templates]]
</includeonly>
+
}}</includeonly>

Latest revision as of 22:04, 25 April 2020

This template produces a standard box to start a sound file. It has some extra features to help linking to a phonetic sound file. When the audio file is not specified, the file based on the symbol will be fetched from Module:IPA symbol/data. Basic examples:

Input options

  • |label=: content above the soundbox (the symbol with link if empty)
  • |size=250px: width of the entire template
  • |font-size=120%: font size of the IPA symbol
  • |line-height=1.5: line height of the IPA symbol
  • |hidecc=yes: hides the CC (closed captions) button

If the audio file doesn't exist, the symbol will still be shown but the template will categorize the page into Category:IPA pages with non-existing IPA audio soundfile.

See also