summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--sphinx/ext/apidoc.py7
2 files changed, 8 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index ea502dbdc..dcd20947b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -137,7 +137,7 @@ Features added
are now generated with their own specific CSS classes
(``added``, ``changed`` and ``deprecated``, respectively) in addition to the
generic ``versionmodified`` class.
-
+* #5841: apidoc: Add --extensions option to sphinx-apidoc
Bugs fixed
----------
diff --git a/sphinx/ext/apidoc.py b/sphinx/ext/apidoc.py
index c0c8c6bcb..6fe4921ab 100644
--- a/sphinx/ext/apidoc.py
+++ b/sphinx/ext/apidoc.py
@@ -371,6 +371,8 @@ Note: By default this script will not overwrite already created files."""))
'defaults to --doc-version'))
group = parser.add_argument_group(__('extension options'))
+ group.add_argument('--extensions', metavar='EXTENSIONS', dest='extensions',
+ action='append', help=__('enable arbitrary extensions'))
for ext in EXTENSIONS:
group.add_argument('--ext-%s' % ext, action='append_const',
const='sphinx.ext.%s' % ext, dest='extensions',
@@ -439,6 +441,11 @@ def main(argv=sys.argv[1:]):
if args.extensions:
d['extensions'].extend(args.extensions)
+ for ext in d['extensions'][:]:
+ if ',' in ext:
+ d['extensions'].remove(ext)
+ d['extensions'].extend(ext.split(','))
+
if not args.dryrun:
qs.generate(d, silent=True, overwrite=args.force)
elif args.tocfile: