Benoît Bryon committed 2b1f681

Added -l, --followlinks option to sphinx-apidoc.

  • Participants
  • Parent commits 1f3a274
  • Branches apidoc-symlinks

Comments (0)

Files changed (2)


    This sets the maximum depth of the table of contents, if one is generated.
+.. option:: -l, --followlinks
+   This option makes sphinx-apidoc follow symbolic links when recursing the
+   filesystem to discover packages and modules. You may need it if you want
+   to generate documentation from a source directory managed by
+   `collective.recipe.omelette
+   <>`_.
+   Defaults to False.
 .. option:: -T, --no-toc
    This prevents the generation of a table-of-contents file ``modules.rst``.
         root_package = None
     toplevels = []
-    for root, subs, files in os.walk(rootpath):
+    followlinks = getattr(opts, 'followlinks', False)
+    for root, subs, files in os.walk(rootpath, followlinks=followlinks):
         if is_excluded(root, excludes):
             del subs[:]
                       '(default: 4)', type='int', default=4)
     parser.add_option('-f', '--force', action='store_true', dest='force',
                       help='Overwrite all files')
+    parser.add_option('-l', '--follow-links', action='store_true',
+                      dest='followlinks', default=False,
+                      help='Follow symbolic links. Powerful when combined ' \
+                           'with collective.recipe.omelette.')
     parser.add_option('-n', '--dry-run', action='store_true', dest='dryrun',
                       help='Run the script without creating files')
     parser.add_option('-T', '--no-toc', action='store_true', dest='notoc',