How could I customize placeholders in my .rst file with actual values?
For example, I have example.rst file with following content:
Header
------------------------------------
${custom_text}
I want to replace ${custom_text} property with the value this is the value of custom property by running following command:
rst2html example.rst -o example.html -Dcustom_text="this is the value of custom property"
Also I wonder whether it is possible to customize template using .properties file? For example, I would like to run rst2html example.rst -o example.html -p example.properties command using example.properties file with following content:
custom_text=this is the value of custom property
Is it possible? Does reStructuredText support template features at all?
EDIT: Please note that I want to customize template from command line or using conventional .properties file (can be used by Ant/Maven build management tool).
Substitution in reStructuredText files is performed using the
replacedirective. For example:will result in the text
You could use the
includedirective to define a list of substitution templates in a separate file. For example, given the following two files:example.rst:
properties.rst
will result in the document:
Header
I can include text, like “example text”, from other files.
Here I have used the command
rst2html.py example.rstto generate the HTML output.