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

From blackwiki
Jump to navigation Jump to search
imported>DePiep
(+Intricate template)
imported>Redrose64
(→‎Input options: fix for exposed strip markers)
Line 21: Line 21:
  
 
====Input options====
 
====Input options====
:a. {{code|<nowiki>checkexist=no</nowiki>}}: skip (expensive) check on file existence. Default=yes (do the check).
+
: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):
 
:b. layout of the soundbox (these settings use basic layout parameters):
:-  {{code|<nowiki>showicon=no</nowiki>}}: show info icon ("noicon" in basic)
+
:-  {{para|showicon|no}}: show info icon ("noicon" in basic)
:- {{code|<nowiki>size=50px</nowiki>}} size (in px: default =250px, minimum is ~40px) Basic: width.
+
:- {{para|size|50px}} size (in px: default =250px, minimum is ~40px) Basic: width.
:- {{code|<nowiki>style</nowiki>}}: any style (CSS format) to be used, e.g. {{code|<nowiki>style=background:yellow;</nowiki>}}
+
:- {{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>}} →
 
* {{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;}}
 
{{IPA soundbox| ipa symbol=m| size=120px| style=border:1px solid red; background:yellow;}}
Line 31: Line 31:
 
:c. When an error would exist, show an error message:
 
:c. When an error would exist, show an error message:
 
:- default: show errormessage as <span class="error">error message</span>
 
:- default: show errormessage as <span class="error">error message</span>
:- {{code|<nowiki>errortext=something is wrong</nowiki>}}: Show alternate text when error
+
:- {{para|errortext|something is wrong}}: Show alternate text when error
:- {{code|<nowiki>errortext=</nowiki>}}: blank, no output at all (no showbox)
+
:- {{para|errortext}}: blank, no output at all (no showbox)
  
 
Example of check file once:
 
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 {{code|<nowiki>checkexist=no</nowiki>}}.
+
*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:
 
;Full parameter list:

Revision as of 17:35, 15 March 2016

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:

Usage

The box is created in three steps:
Step 1. Determine the soundfile name

- By using input IPA symbol, looked up in a list: ipa symbol=p
- Use input soundfile: soundfile=bilabial click.ogg

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 [[File:soundfile]] Here the information is put together, optional settings such as size are used, and the result is soundbox.

Input options

a. |checkexist=no: skip (expensive) check on file existence. Default=yes (do the check).
b. layout of the soundbox (these settings use basic layout parameters):
- |showicon=no: show info icon ("noicon" in basic)
- |size=50px size (in px: default =250px, minimum is ~40px) Basic: width.
- |style=: any style (CSS format) to be used, e.g. |style=background:yellow;
  • {{IPA soundbox|| ipa symbol=m| size=120px| style=border:1px solid red; background:yellow;}}
{{{1}}}


c. When an error would exist, show an error message:
- default: show errormessage as error message
- |errortext=something is wrong: Show alternate text when error
- |errortext=: blank, no output at all (no showbox)

Example of check file once:

  • See {{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 |checkexist=no.
Full parameter list
{{IPA soundbox
<!-- GENERAL -->
| ipa symbol    =
| style         =
| errortext     =
<!-- ABOVE -->
| show box above=
| showsymbol    =
| line-height   =
<!-- PLAYER -->
| soundfile     =
| checkexist    =
| showicon      =
| width         =
| size          =
}}
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