.. include:: <isonnums.txt>
I'd like to use some of the common symbol entity substitutions afforded by restructured text in my Sphinx docs, using
.. include:: <isonnums.txt>
and so forth. Is there a way to include this file once for my whole project, so that I can use the |copy| and similar substitutions in all documents in my project? As it stands, it appears I have to .. include the file for every RST file in my project where I use such a substitution...
Hi Victor,
I’m not sure if this is exactly what you have in mind…
We use a single substitutions file for 3 different sets of documentation. It lives a directory above each set of documentation project.
Documentation
-- 00-Sandbox-directory
-- Product-A-directory
-- Product-B-directory
-- Product-C-directory
-- extensions-directory-for-all-products
substitutions.rst
All files in each product directory contain the following line at the top of each document (line 1), followed by the chapter title:
.. include:: ../../substitutions.rst
==================
Chapter Title Here
==================
Kathy
http://sphinx.pocoo.org/config.html#confval-rst_epilog
All files in each product directory contain the following line at the top of each document (line 1), followed by the chapter title:
Yes, what I'd like to avoid is exactly that "each file containing the following line at the top of each document". Luckily a more elegant solution exists: the "rst_epilog" and "rst_prolog" configuration values…
Thanks. That is sweet! But, it doesn’t format the accent in the PDF output (missing a MikTex package?). Our substitutions require :raw-html: and :raw-latex: in order to display correctly in HTML and in the PDF. So, we’ll have to stick with our substitution line solution at the top of all docs. Great to know, though!
.. |sampletest| replace:: :raw-html:`<strong><em>SAMPLE</em> Test</strong>`:raw-latex:`{\textbf {\em SAMPLE} Test}`
Kathy
Thanks. That is sweet! But, it doesn’t format the accent in the PDF output (missing a MikTex package?). Our substitutions require :raw-html: and :raw-latex: in order to display correctly in HTML and in the PDF. So, we’ll have to stick with our substitution line solution at the top of all docs. Great to know, though!