Template:EDFs: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
ArrowHead294 (talk | contribs)
No edit summary
Change regex rule for more complex wart notation. This also fixes fractional numbers (e.g. "ed3/2") not being included as part of the link.
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#if: {{{legend|}}}|[[edf]]s:&nbsp;}}{{#regex: {{{1|}}}|/(\d+)(\D+)?/|[[\1edf|\1]]\2}}<noinclude>
<includeonly>{{#switch: {{{legend|}}}|1=[[EDF]]s:&nbsp;|0=EDFs:&nbsp;}}{{#rreplace: {{{1|}}}|/(\d+)([\w\*\/†′″]*)/|[[\1edf|\1\2]]}}</includeonly><noinclude>
This template takes a collection of numbers and creates links to individual [[edf]] pages from it.
{{Documentation}}
 
== Usage examples ==
 
; You type:
* <code><nowiki>{{EDFs|1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}}</nowiki></code>
* <code><nowiki>{{EDFs|1 2 3 4 5 6 7 8 9 10 11}}</nowiki></code>
* <code><nowiki>{{EDFs|1 edf, 2 edf, up to 99 edf 00}}</nowiki></code>
 
; You get (rendered):
* {{EDFs|1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}}
* {{EDFs|1 2 3 4 5 6 7 8 9 10 11}}
* {{EDFs|1 edf, 2 edf, up to 99 edf 00}} - disputable if leading zeros should be removed
 
; To include a legend, type:
* <code><nowiki>{{EDFs| legend=1 | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }}</nowiki></code>
 
; So you get (rendered):
* {{EDFs| legend=1 | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}}
 
== Technical notes ==
* [https://www.mediawiki.org/wiki/Extension:Regex_Fun MediaWiki: Extension: Regex Fun]
 
== See also ==
* [[Template: EDTs]]
* [[Template: EDOs]]
* [[Template: Optimal ET sequence]]


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

Latest revision as of 17:39, 13 October 2026

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

The EDFs template takes a collection of numbers and creates links to individual edf pages from it. Alphanumeric characters (e.g. edf) 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 examples

You type
  • {{EDFs| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }}
  • {{EDFs| 1 2 3 4 5 6 7 8 9 10 11 }}
  • {{EDFs| 1edf, 2edf, up to 99edf }}
You get (rendered)
To include a legend, type
  • {{EDFs|legend=0| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }}
  • {{EDFs|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