Template:ZPIs: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
ArrowHead294 (talk | contribs)
No edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
Line 1: Line 1:
{{#if: {{{legend|}}}|[[ZPI]]s:&nbsp;}}{{#regex: {{{1|}}}|/(\d+)(\D+)?/|[[\zpi|\1]]\2}}<noinclude>
{{#if: {{{legend|}}}|[[ZPI]]s:&nbsp;}}{{#regex: {{{1|}}}|/(\d+)(\D+)?/|[[\zpi|\1]]\2}}<noinclude>
This template takes a collection of numbers and creates links to individual [[zpi]] pages from it.
{{documentation}}
 
{{doc}}


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

Revision as of 16:24, 31 January 2025

{{#regex: |/(\d+)(\D+)?/|\1\2}}

Template documentation[view] [edit] [history] [purge]

This template takes a collection of numbers and creates links to individual zpi pages from it.

Usage examples

You type
  • {{ZPIs|1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}}
  • {{ZPIs|1 2 3 4 5 6 7 8 9 10 11}}
  • {{ZPIs|1 afdo, 2 afdo, up to 99 afdo 00}}
You get (rendered)
  • {{#regex: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11|/(\d+)(\D+)?/|\1\2}}
  • {{#regex: 1 2 3 4 5 6 7 8 9 10 11|/(\d+)(\D+)?/|\1\2}}
  • {{#regex: 1 zpi, 2 zpi, up to 99 zpi 00|/(\d+)(\D+)?/|\1\2}} – disputable if leading zeros should be removed
To include a legend, type
  • {{ZPIs|legend=1| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }}
So you get (rendered)
  • ZPIs: {{#regex: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11|/(\d+)(\D+)?/|\1\2}}

Technical notes

See also