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

From blackwiki
Jump to navigation Jump to search
imported>Bgeron
m (→‎Usage: Fix link to sound documentation)
imported>Nardog
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 ===
 
The box is created in three steps:<br>
 
'''Step 1'''. Determine the soundfile name
 
:- By using input IPA symbol, looked up in a list: {{code|ipa symbol{{=}}p}} &rarr; {{IPA soundbox|p|checkexist=no|showbox=no}}
 
:- Use input soundfile: {{code|soundfile{{=}}bilabial click.ogg}}&rarr; {{IPA soundbox|ʘ|soundfile=bilabial click.ogg|checkexist=no}}
 
 
'''Step 2'''. Check if the soundfile exists
 
This check may prevent red links and (undesired) repeated checks
 
 
'''Step 3'''. Create the standard browser soundbox on the page, using [[WP:EIS#Multimedia syntax|<nowiki>[[File:soundfile]]</nowiki>]]
 
Here the information is put together, optional settings such as size are used, and the result is soundbox.
 
* {{tlx|IPA soundbox|p||size{{=}}60px}} →
 
* {{IPA soundbox|p||size=60px}}
 
  
 
====Input options====
 
====Input options====
:a. {{para|checkexist|no}}: skip (expensive) check on file existence. Default=yes (do the check).
+
* {{para|size|250px}}: width of the entire template
:b. layout of the soundbox (these settings use basic layout parameters):
+
* {{para|font-size|120%}}: font size of the IPA symbol
:-  {{para|showicon|no}}: show info icon ("noicon" in basic)
+
* {{para|line-height|1.5em}}: line height of the IPA symbol
:- {{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:
+
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]].
:1. IPA symbol unknown in IPAsym list
 
:2. File does not exist
 
:When an error exists, no button will be shown.
 
  
 
=== See also ===
 
=== See also ===
* {{tlx|IPA audio filename}}
 
 
* {{tlx|infobox IPA}} (uses this template internally)
 
* {{tlx|infobox IPA}} (uses this template internally)
 
* {{tlx|IPA vowels audio}} (uses this template internally)
 
* {{tlx|IPA vowels audio}} (uses this template internally)

Revision as of 12:43, 23 May 2017

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

  • |size=250px: width of the entire template
  • |font-size=120%: font size of the IPA symbol
  • |line-height=1.5em: line height of the IPA symbol

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