summaryrefslogtreecommitdiff
path: root/sphinx/apidoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-09-17 14:49:52 +0200
committerGeorg Brandl <georg@python.org>2013-09-17 14:49:52 +0200
commita8b872c9250bd84dbfea82f733684969b6ed4019 (patch)
tree7ad9ce9782077d0ec66ade4a5246ca9511366243 /sphinx/apidoc.py
parentd0cf2617cf43c4fc66968b595d866168aec27fad (diff)
downloadsphinx-git-a8b872c9250bd84dbfea82f733684969b6ed4019.tar.gz
Changelog entry and cleanup for PR#131.
Diffstat (limited to 'sphinx/apidoc.py')
-rw-r--r--sphinx/apidoc.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/sphinx/apidoc.py b/sphinx/apidoc.py
index 9948b1cc2..226acaa63 100644
--- a/sphinx/apidoc.py
+++ b/sphinx/apidoc.py
@@ -102,8 +102,8 @@ def create_package_file(root, master_package, subroot, py_files, opts, subs):
heading = ':mod:`%s` Module' % py_file
# option to have each module go on its own page
- if (opts.separatepages):
- if (is_package):
+ if opts.separatepages:
+ if is_package:
# we handle packages SLIGHTLY differently in this case; no need
# for double nested heading for package that apidoc usually does
# since all other modules are going to be on separate pages
@@ -113,7 +113,7 @@ def create_package_file(root, master_package, subroot, py_files, opts, subs):
# with separatepages option, instead of embedding all module
# file contents on the one package page, each module will have
# its own page.
- outfilepath = py_path + '.singlepage'
+ outfilepath = makename(master_package, py_path)
# text for this page just links to standalone page
text += '.. toctree::\n\n'
text += ' %s\n\n' % outfilepath
@@ -122,7 +122,7 @@ def create_package_file(root, master_package, subroot, py_files, opts, subs):
# heading.
filetext = format_heading(1, heading)
filetext += format_directive(is_package and subroot or py_path,
- master_package)
+ master_package)
# write out standalone page file
write_file(outfilepath, filetext, opts)
else:
@@ -283,6 +283,9 @@ Note: By default this script will not overwrite already created files.""")
'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('-E', '--separate', action='store_true',
+ dest='separatepages',
+ help='Put documentation for each module on its own page')
parser.add_option('-T', '--no-toc', action='store_true', dest='notoc',
help='Don\'t create a table of contents file')
parser.add_option('-s', '--suffix', action='store', dest='suffix',
@@ -299,10 +302,6 @@ Note: By default this script will not overwrite already created files.""")
parser.add_option('-R', '--doc-release', action='store', dest='release',
help='Project release, used when --full is given, '
'defaults to --doc-version')
- parser.add_option('-E', '--separate', action='store_true', dest='separatepages',
- help='Put each module file in its own page, ')
-
-
(opts, args) = parser.parse_args(argv[1:])