diff options
author | Lewis Haley <lewis.haley@youview.com> | 2018-08-08 16:26:11 +0100 |
---|---|---|
committer | Lewis Haley <lewis.haley@youview.com> | 2018-08-17 15:51:00 +0100 |
commit | 6e1e35c98ac29397d4552caf72710ccf4bf98bea (patch) | |
tree | 018b4bcd90d43625c0bd888f4db836053d98504c /sphinx/ext/autodoc/directive.py | |
parent | 87029392fd73521a3d25e3ceba363c19d93a3c7a (diff) | |
download | sphinx-git-6e1e35c98ac29397d4552caf72710ccf4bf98bea.tar.gz |
autodoc: allow specifying values to global arguments
Previously, users could specify a *list* of flags in their config files.
The flags were directive names that would otherwise be present in the
.rst files. However, as a list, it was not possible to specify values
to those flags, which *is* possible in .rst files.
For example, in .rst you could say
:special-members: __init__, __iter__
And this would cause autodoc to generate documents for these methods that
it would otherwise ignore.
This commit changes the config option to instead accept a dictionary.
This is a dictionary whose keys can contain the same flag-names as before,
but whose values can contain the arguments as seen in .rst files.
The old list is still supported, for backwards compatibility, but the data
is transformed into a dictionary when the user's config is loaded.
Diffstat (limited to 'sphinx/ext/autodoc/directive.py')
-rw-r--r-- | sphinx/ext/autodoc/directive.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sphinx/ext/autodoc/directive.py b/sphinx/ext/autodoc/directive.py index 64d19fcc7..aabf6b47d 100644 --- a/sphinx/ext/autodoc/directive.py +++ b/sphinx/ext/autodoc/directive.py @@ -68,7 +68,7 @@ def process_documenter_options(documenter, config, options): else: negated = options.pop('no-' + name, True) is None if name in config.autodoc_default_flags and not negated: - options[name] = None + options[name] = config.autodoc_default_flags[name] return Options(assemble_option_dict(options.items(), documenter.option_spec)) |