template_example

View page source

Template Command Example

xrst_template

The file below demonstrates the use of xrst_template .

This Example File

# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: Bradley M. Bell <bradbell@seanet.com>
# SPDX-FileContributor: 2020-24 Bradley M. Bell
# ----------------------------------------------------------------------------
{xrst_begin_parent template_example}

Template Command Example
########################

xrst_template
*************
The file below demonstrates the use of ``xrst_template`` .

This Example File
*****************
{xrst_literal}

{xrst_end template_example}
# ----------------------------------------------------------------------------
{xrst_begin example_expansion_one}

{xrst_comment BEGIN_EXPANSION_one}
{xrst_template ,
   example/template_file.xrst
   @Title@        , First Expansion
   @#####@        , ###############
   @number@       , one
   @case@         , first
}
{xrst_comment END_EXPANSION_one}

{xrst_end example_expansion_one}
# ----------------------------------------------------------------------------
{xrst_begin example_expansion_two}

{xrst_comment BEGIN_EXPANSION_two}
{xrst_template ;
   example/template_file.xrst

   headers   : Expansion Number, Spelling, First Paragraph, Second Paragraph
   @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, ...
   @case@    : if first (second) the first (second) paragraph is displayed

   @Title@  ; Second Expansion
   @#####@  ; ################
   @number@ ; two
   @case@   ; second
}
{xrst_comment END_EXPANSION_two}

{xrst_end example_expansion_two}
# ----------------------------------------------------------------------------

Child

Title

example_expansion_one

First Expansion

example_expansion_two

Second Expansion