\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\)
example_expansion_one¶
View page sourceFirst Expansion¶
Expansion Number¶
This is expansion number one of the template file
example/template_file.xrst
.
Spelling¶
Template files can not have spell commands .
Every page that uses a template file will have to include
the template file special words it the page’s spell command.
You can avoid this by surrounding the intended use of special words,
and double words, by
{xrst_spell_off}
and {xrst_spell_on}
.
This is what is done in the following sentence:
Using ‘myspecialword’ and using ‘double double’ are OK here.
First Paragraph¶
This paragraph is displayed if the case argument is first.
Third Paragraph¶
This paragraph is displayed if the case argument is not third.
This Template File¶
{xrst_spell_off}
{xrst_comment
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: Bradley M. Bell bradbell at seanet dot com
SPDX-FileContributor: 2020-25 Bradley M. Bell
}
{xrst_spell_on}
{xrst_comment
This is an example xrst-template file.
An expansion of this file will create the followng headings:
headers : Expansion Number, Spelling, First Paragraph, Second Paragraph
This file has the following template replacements:
@Title@ : is the title for this page
@#####@ : is the rst underlining for the title
@number@ : is the number for this page; e.g., one, two, ...
This template uses BEGIN_EXPANSION_@number@ and
END_EXPANSION_@number@ for the limits of the xrst_template command
in the page file that is using this template.
@case@ : if first (second) the first (second) paragraph is displayed
}
@Title@
@#####@
Expansion Number
****************
This is expansion number @number@ of the template file
``example/template_file.xrst`` .
Spelling
********
Template files can not have :ref:`spell commands<spell_example-name>` .
Every page that uses a template file will have to include
the template file special words it the page's spell command.
You can avoid this by surrounding the intended use of special words,
and double words, by
``\{xrst_spell_off}`` and ``\{xrst_spell_on}`` .
This is what is done in the following sentence:
{xrst_spell_off}
Using 'myspecialword' and using 'double double' are OK here.
{xrst_spell_on}
{xrst_suspend @case@ != first}
First Paragraph
***************
This paragraph is displayed if the case argument is first.
{xrst_resume}
{xrst_suspend @case@ != second}
Second Paragraph
****************
This paragraph is displayed if the case argument is second.
{xrst_resume}
{xrst_suspend @case@ == third}
Third Paragraph
***************
This paragraph is displayed if the case argument is not third.
{xrst_resume}
This Template File
******************
{xrst_literal
example/template_file.xrst
}
This Template Usage
*******************
{xrst_literal
BEGIN_EXPANSION_@number@
END_EXPANSION_@number@
}
This Template Usage¶
{xrst_template ,
example/template_file.xrst
@Title@ , First Expansion
@#####@ , ###############
@number@ , one
@case@ , first
}