From 656b13b04627a7c226fb6367ca4323c4971d5f48 Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Mon, 20 Sep 2021 18:12:57 +0200 Subject: [PATCH] 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. --- src/options/mkoptions.py | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.30.2