And you want some rebranding based on an alias within a product.
I'm going to make some assumptions:
- The rebranding is only textual or theme parameters.
- Your documentation sources are in RST format (not Markdown extension etc.).
Given that, you could do some simple substitutions with rst_epilog [1].
Write lines in RST like:
This is the documentation for |productx|. In order to use |productx|...
And in conf.py:
rst_epilog = '.. |productx| replace:: Product X please_replace_me'
Run your builds with the parameter as variable to override in conf.py [2], example with both make and
sphinx-build approach:
make SPHINXOPTS="-D rst_epilog='.. |productx| replace:: Red'" [...] # make, other options and target omitted
sphinx-build -D rst_epilog='.. |productx| replace:: Red' [...] # plain sphinx-build, other options omitted
Alternatively, read an environment variable in conf.py and have set that accordingly for each customer,
but with the same command for all builds.
(Or, alternatively, have a red/conf.py in which you import everything from common/conf.py, but override the
rst_epilog variable. But I guess you wanted a more dynamic approach on the command line.)
For HTML/theme variables, use the -A option [3] instead, but that totally depends on your theme and the
amount of customization you put in there.
If you're looking for a way to produce output for each customer with a single sphinx-build command,
you may want to write a Python script that pulls the client-product-alias from your database and spins
up sphinx-build programmatically with a config override just like I did above. For inspiration on the
programmatic approach, I would recommend to look at how sphinxcontrib-versioning does it for building
for each version of a project [4].
HTH