Template:EDOs: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
CompactStar (talk | contribs)
No edit summary
Add slash to the pattern for fraction notation (e.g. ed2/1)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#if: {{{legend|}}} | ED{{{equave|o}}}]]s:&nbsp;}}{{#regex: {{{1|}}}|/(\d+)(\D+)?/|[[\1ed{{{equave|o}}}|\1]]\2}}<noinclude>
<includeonly>{{#switch: {{{legend|}}}|1=[[EDO]]s:&nbsp;|0=EDOs:&nbsp;}}{{#rreplace: {{{1|}}}|/(\d+)([\w\*\/†′″]*)/|[[\1edo|\1\2]]}}</includeonly><noinclude>
 
{{Documentation}}
This template takes a collection of numbers and creates links to individual [[edo]] pages from it.
 
== Usage examples ==
 
; You type:
* <code><nowiki>{{EDOs|1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}}</nowiki></code>
* <code><nowiki>{{EDOs|1 2 3 4 5 6 7 8 9 10 11}}</nowiki></code>
* <code><nowiki>{{EDOs|1 edo, 2 edo, up to 99 edo 00}}</nowiki></code>
 
; You get (rendered):
* {{EDOs|1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}}
* {{EDOs|1 2 3 4 5 6 7 8 9 10 11}}
* {{EDOs|1 edo, 2 edo, up to 99 edo 00}} - disputable if leading zeros should be removed
 
; To include a legend, type:
* <code><nowiki>{{EDOs| legend=1 | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }}</nowiki></code>
 
; So you get (rendered):
* [[EDO]]s: {{EDOs|1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}}
 
== Technical notes ==
 
* [https://www.mediawiki.org/wiki/Extension:Regex_Fun Extension&#58;Regex Fun &#45; MediaWiki]
 
[[Category:Templates]]


[[Category:Formatting templates]]
</noinclude>
</noinclude>

Latest revision as of 17:44, 13 October 2026

Template documentation[view] [edit] [history] [purge]
This template should not be substituted.

The EDOs template takes a collection of numbers and creates links to individual edo pages from it. Alphanumeric characters (e.g. edo) immediately after a number are included in the link, as well as asterisk (*), slash (/), dagger (†), prime (′) and double-prime (″) to help with fraction notation and extended wart notation.

Usage

You type
  • {{EDOs| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }}
  • {{EDOs| 1 2 3 4 5 6 7 8 9 10 11 }}
  • {{EDOs| 1edo, 2edo, up to 99edo }}
You get (rendered)
To include a legend, type
  • {{EDOs|legend=0| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }}
  • {{EDOs|legend=1| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }}
So you get (rendered)

Technical notes

This template calls Extension: RegexFunctions to match the strings.

See also