deb-oslo.config/doc/source/sphinxconfiggen.rst
Matthew Treinish 006415f41b
Add sphinx extension to build sample config
This commit adds a sphinx extension which can be loaded in a sphinx
config.py to generate a sample config file using oslo-config-generator
during each sphinx build. This can then be incorporated into
documentation as necessary.

Co-Authored-By: Doug Hellmann <doug@doughellmann.com>
Change-Id: I2561155749fc8c6a8e31df1614ca6cdb50b4c001
2015-08-11 10:18:40 -04:00

1.2 KiB

Sphinx Oslo Sample Config Generation

Included with oslo.config is a sphinx extension to generate a sample config file at the beginning of each sphinx build. To activate the extension add oslo_config.sphinxgenconfig to the list of extensions in your sphinx conf.py.

Then you just need to use the config_generator_config_file option to point the config generator at the config file which tells it how to generate the sample config. If one isn't specified or it doesn't point to a real file the sample config file generation will be skipped.

Output File Name

By default the sphinx plugin will generate the sample config file and name the file sample.config. However, if for whatever reason you'd like the name to be more specific to the project name you can use the config_sample_basename config option to specify the project name. If it's set the output filename will be that value with a .conf.sample extension. For example if you set that to be nova the output filename will be nova.conf.sample. You can also put a subdirectory off of the srcdir as part of this value.