Commits

pv committed 40b34c3

autosummary: accept 'autosummary_generate = True' in config files

  • Participants
  • Parent commits 39857a3

Comments (0)

Files changed (2)

File doc/ext/autosummary.rst

      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::
 
 .. 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.

File sphinx/ext/autosummary/__init__.py

 
 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