From 8f62ca7b3060b87ede0a55c1972e5d2146a23890 Mon Sep 17 00:00:00 2001 From: Paul Beesley Date: Wed, 13 Mar 2019 13:58:02 +0000 Subject: doc: Add minimal glossary One of the current issues with the documentation is that terms and abbreviations are frequently redefined. For example, we might have a sentence like "... the SCP (System Control Processor) will ...". These definitions might be repeated several times across pages, or even within the same document. Equally, some of these abbreviations are missed and are never expanded. Sphinx provides a :term: keyword that takes some text and, if that text is defined in a glossary document, links to its glossary entry. Using this functionality will prevent repeated definitions and will make the docs more maintainable by using a single definition source. The glossary added in this patch was created from a quick scrub of the source code - there may be missing entries. The SDEI abbreviation was used as an example. Note that a global_substitutions file was created. This file contains the RST 'replace' statements that convert plain text terms into linked terms (by adding the ':term:' keyword to them). An example is: .. |TF-A| replace:: :term:`TF-A` The 'rst_prolog' variable in conf.py is used to inject this list of replacements into each page. Terms must be surrounded with the pipe character to be turned into links - this means that we can still prevent certain terms from being linked if we don't want them to be. Change-Id: I87010ed9cfa4a60011a9b4a431b98cb4bb7baa28 Signed-off-by: Paul Beesley --- docs/conf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'docs/conf.py') diff --git a/docs/conf.py b/docs/conf.py index 0fcc50d2..697b8711 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,6 +9,8 @@ # # See the options documentation at http://www.sphinx-doc.org/en/master/config +import os + # -- Project information ----------------------------------------------------- project = 'Trusted Firmware-A' @@ -16,7 +18,6 @@ project = 'Trusted Firmware-A' version = '2.1' release = version # We don't need these to be distinct - # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be @@ -48,6 +49,10 @@ exclude_patterns = [] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' +# Load the contents of the global substitutions file into the 'rst_prolog' +# variable. This ensures that the substitutions are all inserted into each page. +with open('global_substitutions.txt', 'r') as subs: + rst_prolog = subs.read() # -- Options for HTML output ------------------------------------------------- -- cgit v1.2.3