summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGereon Kremer <nafur42@gmail.com>2021-09-20 18:12:57 +0200
committerGitHub <noreply@github.com>2021-09-20 09:12:57 -0700
commit656b13b04627a7c226fb6367ca4323c4971d5f48 (patch)
treefaf964555bc9b32b3412172946c9be2dd15855ac
parent84a95435ef3d92ea6ee969a574b9fa98d569f93f (diff)
Add anchors to cmdline options (#7210)
This PR adds anchors to the auto-generates command line option documentation. This allows to link to specific options from other parts of the documentation.
-rw-r--r--src/options/mkoptions.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/options/mkoptions.py b/src/options/mkoptions.py
index c12a54ebb..a8f631de6 100644
--- a/src/options/mkoptions.py
+++ b/src/options/mkoptions.py
@@ -784,6 +784,7 @@ def _sphinx_help_add(module, option, common, others):
modes[data[0]['name']] = data[0].get('help', '')
data = {
+ 'long_name': option.long_name,
'name': names,
'help': option.help,
'expert': option.category == 'expert',
@@ -805,6 +806,8 @@ def _sphinx_help_render_option(res, opt):
indent = ' ' * 4
desc = '``{}``'
val = indent + '{}'
+ res.append('.. _lbl-option-{}:'.format(opt['long_name']))
+ res.append('')
if opt['expert']:
res.append('.. admonition:: This option is intended for Experts only!')
res.append(indent)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback