Difference between revisions of "Template:Bc subst/doc"
Jump to navigation
Jump to search
imported>Vanisaac (subst only) |
imported>Vanisaac (documenting addition of image support and the data files which the template uses) |
||
| Line 6: | Line 6: | ||
{{Subst only|alt=Braille cell}} | {{Subst only|alt=Braille cell}} | ||
| − | This template is a [[WP:Substitution|subst:]]-able version of the {{tl|braille cell}} template that returns plain text unicode | + | This template is a [[WP:Substitution|subst:]]-able version of the {{tl|braille cell}} template that returns a single plain text unicode character or 8-dot braille cell image. |
[[image:Braille8dotCellNumbering.svg|thumb|60px|braille dot numbers]] | [[image:Braille8dotCellNumbering.svg|thumb|60px|braille dot numbers]] | ||
| − | <code><nowiki>{{</nowiki>subst:bc subst|'''pattern'''<nowiki>}}</nowiki></code> | + | <code><nowiki>{{</nowiki>subst:bc subst|'''pattern'''<nowiki>|'''type'''=''image''|'''size'''=}}</nowiki></code> |
* '''pattern''' is the numbers of the raised dots in numeric order, eg 1348 for {{bc|1348|type=image|size=12px}}. Default is no dots (pattern 0). | * '''pattern''' is the numbers of the raised dots in numeric order, eg 1348 for {{bc|1348|type=image|size=12px}}. Default is no dots (pattern 0). | ||
| + | * '''type''' can be set to ''image'' to return an 8-dot braille cell image. Any other input returns a unicode character. | ||
| + | * '''size''' can be used to specify the size of an 8-dot braill cell image. Default 12px. | ||
| + | |||
| + | ==Technical details== | ||
| + | This template directly calls subpages of the {{tl|braille cell}} template, and does not contain any data files of its own. | ||
| + | |||
| + | The braille pattern input is evaluated and processed using either: | ||
| + | |||
| + | * {{tl|Braille cell/dot-id2character}}: braille pattern into text character (Unicode) | ||
| + | * {{tl|Braille cell/dot-id2filename-8dot}}: braille pattern into a default 8-dot filename | ||
| + | |||
| + | These data files contain several one-off and error codes, and any invalid braille patterns entered may produce a non-standard result or error. | ||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| | <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| | ||
Revision as of 11:52, 31 January 2014
| 40px | This is a documentation subpage for Template:Bc subst. It contains usage information, categories and other content that is not part of the original template page. |
Usage
| 40x40px | This template should always be substituted (i.e., use {{subst:Bc subst}}). For transcluding, use {{Braille cell}} instead. |
This template is a subst:-able version of the {{braille cell}} template that returns a single plain text unicode character or 8-dot braille cell image.
File:Braille8dotCellNumbering.svg
braille dot numbers
{{subst:bc subst|pattern|'''type'''=''image''|'''size'''=}}
- pattern is the numbers of the raised dots in numeric order, eg 1348 for ⢍ (braille pattern dots-1348) U+288D. Default is no dots (pattern 0).
- type can be set to image to return an 8-dot braille cell image. Any other input returns a unicode character.
- size can be used to specify the size of an 8-dot braill cell image. Default 12px.
Technical details
This template directly calls subpages of the {{braille cell}} template, and does not contain any data files of its own.
The braille pattern input is evaluated and processed using either:
- {{Braille cell/dot-id2character}}: braille pattern into text character (Unicode)
- {{Braille cell/dot-id2filename-8dot}}: braille pattern into a default 8-dot filename
These data files contain several one-off and error codes, and any invalid braille patterns entered may produce a non-standard result or error.