Template:Stanza/doc

From Wikisource
Jump to navigation Jump to search

Warning[edit]

This template has known currently unresolved problems. Please see template talk:stanza for more detail.

Usage[edit]

This template renders a block of text with constant leading and specified left margin and hanging indent. The result is similar to enclosing the text block within <poem> … </poem>; i.e. internal line ends are preserved, however multiple blank lines are suppressed, and the result subjected overall to the margin rules specified.

Parameters (first two identical to those of {{hii}}:

  • 1: text to be rendered as described above.
  • margin: indentation (in em; default: 0) of first line relative to the other lines of the paragraph (i.e. CSS "text-indent".)
  • indent: indentation (in em; default: 0) of the whole paragraph (i.e. the CSS "margin-left".)

Note: indentation is measured rightwards. To "reverse indent" (make a line stick out to the left), enter a negative value. To support leading drop capital/drop initial (all subsequent parameters are optional):

  • capital (aliases initial or di): Lead letter to be specially rendered at front of stanza.
  • cap-size (alias di-size): Font size (in em-units; default: 3em) to be used for drop capital.
  • cap-margin-top (alias di-top): Margin spacing to apply on top of drop capital.
  • cap-margin-right (alias di-right): Margin spacing to apply to right of drop capital.
  • cap-margin-bottom (alias di-bottom): Margin spacing to apply beneath drop capital.
  • cap-margin-left (alias di-left): Margin spacing to apply to left of drop capital.
  • cap-text-indent (alias di-indent): Extra indentation to be applied drop capital and portion of stanza "shaded" by it.
  • cap-z-index (alias di-z-index): Passed to {{drop capital}} as named parameter z-index (please amend this description if/when utility or effect of layering index parameter is known.)

Examples[edit]

1. This:

{{block centre|width=280px|{{stanza|indent=4|WHEN beeches bud and lilacs blow,
{{gap}}And Earth puts on her magic green;
When dogwoods bear their vernal snow
{{gap}}And skies grow deep the stars between,—
Then, O ye birds! awake and sing
The gladness at the heart of Spring!}}}}

produces:

WHEN beeches bud and lilacs blow,
And Earth puts on her magic green;
When dogwoods bear their vernal snow
And skies grow deep the stars between,—
Then, O ye birds! awake and sing
The gladness at the heart of Spring!


2. This:

{{block centre|width=280px|{{stanza|indent=4|capital=W|cap-size=2em|cap-margin-top=-0.1em|cap-text-indent=-1em|HEN beeches bud and lilacs blow,
{{gap}}And Earth puts on her magic green;
When dogwoods bear their vernal snow
{{gap}}And skies grow deep the stars between,—
Then, O ye birds! awake and sing
The gladness at the heart of Spring!}}}}

produces:

W
HEN beeches bud and lilacs blow,
And Earth puts on her magic green;
When dogwoods bear their vernal snow
And skies grow deep the stars between,—
Then, O ye birds! awake and sing
The gladness at the heart of Spring!


See also[edit]