File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -8,3 +8,4 @@ stagpy.egg-info/
88docs /_build /
99docs /_static /
1010docs /_templates /
11+ docs /sources /config_opts.rst
Original file line number Diff line number Diff line change @@ -315,3 +315,41 @@ def __getattr__(cls, name):
315315
316316# If true, do not generate a @detailmenu in the "Top" node's menu.
317317#texinfo_no_detailmenu = False
318+
319+ from pathlib import Path
320+ from textwrap import dedent
321+ import stagpy
322+ dfile = Path ('.' ) / 'sources' / 'config_opts.rst'
323+ with dfile .open ('w' ) as fid :
324+ fid .write (dedent (
325+ """\
326+ ..
327+ This doc is automatically generated in conf.py.
328+ Editing it will have no effect.
329+ Modify conf.py instead.
330+
331+ List of configuration options
332+ =============================
333+
334+ These tables list configuration options.
335+ """ ))
336+ for section in stagpy .conf .sections_ ():
337+ fid .write (dedent (
338+ """
339+ .. list-table:: {}
340+ :header-rows: 1
341+
342+ * - Name
343+ - Description
344+ - CLI, config file?
345+ """ .format (section )))
346+ for opt , meta in stagpy .conf [section ].defaults_ ():
347+ if meta .cmd_arg and meta .conf_arg :
348+ c_f = 'both'
349+ elif meta .cmd_arg :
350+ c_f = 'CLI'
351+ else :
352+ c_f = 'config file'
353+ fid .write (' * - {}\n ' .format (opt ))
354+ fid .write (' - {}\n ' .format (meta .help ))
355+ fid .write (' - {}\n ' .format (c_f ))
Original file line number Diff line number Diff line change @@ -53,4 +53,5 @@ Welcome to StagPy's documentation!
5353 sources/apiref/step
5454 sources/apiref/stagyyparsers
5555 sources/apiref/time
56+ sources/config_opts
5657
You can’t perform that action at this time.
0 commit comments