mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
autosummary: accept 'autosummary_generate = True' in config files
This commit is contained in:
parent
39f5e8c3a0
commit
bbf4fe36c1
@ -73,7 +73,8 @@ The :mod:`sphinx.ext.autosummary` extension does this in two parts:
|
||||
that stub pages should be generated for the entries listed in this
|
||||
directive. The option accepts a directory name as an argument;
|
||||
:program:`sphinx-autogen` will by default place its output in this
|
||||
directory.
|
||||
directory. If no argument is given, output is placed in the same directory
|
||||
as the file that contains the directive.
|
||||
|
||||
* If you don't want the :dir:`autosummary` to show function signatures in the
|
||||
listing, include the ``nosignatures`` option::
|
||||
@ -117,5 +118,11 @@ also use this new config value:
|
||||
|
||||
.. confval:: autosummary_generate
|
||||
|
||||
A list of documents for which stub pages should be generated. They will be
|
||||
placed in the directories specified in the ``:toctree:`` options.
|
||||
Boolean indicating whether to scan all found documents for
|
||||
autosummary directives, and to generate stub pages for each.
|
||||
|
||||
Can also be a list of documents for which stub pages should be
|
||||
generated.
|
||||
|
||||
The new files will be placed in the directories specified in the
|
||||
``:toctree:`` options of the directives.
|
||||
|
@ -443,8 +443,14 @@ def autolink_role(typ, rawtext, etext, lineno, inliner,
|
||||
|
||||
def process_generate_options(app):
|
||||
genfiles = app.config.autosummary_generate
|
||||
|
||||
if genfiles and not hasattr(genfiles, '__len__'):
|
||||
env = app.environment
|
||||
genfiles = [env.doc2path(x) for x in env.found_docs]
|
||||
|
||||
if not genfiles:
|
||||
return
|
||||
|
||||
from sphinx.ext.autosummary.generate import generate_autosummary_docs
|
||||
|
||||
ext = app.config.source_suffix
|
||||
|
Loading…
Reference in New Issue
Block a user