Table Of Contents

This Page

generate_doc_modules Module

generate_doc_modules Module

sphinx-autopackage-script

This script parses a directory tree looking for python modules and packages and creates ReST files appropriately to create code documentation with Sphinx. It also creates a modules index (named modules.<suffix>).

generate_doc_modules.create_module_file(package, module, opts)

Build the text of the file and write the file.

generate_doc_modules.create_modules_toc_file(master_package, modules, opts, name='modules')

Create the module’s index.

generate_doc_modules.create_package_file(root, master_package, subroot, py_files, opts, subs)

Build the text of the file and write the file.

generate_doc_modules.format_directive(module, package=None)

Create the automodule directive and add the options.

generate_doc_modules.format_heading(level, text)

Create a heading of <level> [1, 2 or 3 supported].

generate_doc_modules.is_excluded(root, excludes)

Check if the directory is in the exclude list.

Note: by having trailing slashes, we avoid common prefix issues, like
e.g. an exlude “foo” also accidentally excluding “foobar”.
generate_doc_modules.main()

Parse and check the command line arguments.

generate_doc_modules.makename(package, module)

Join package and module with a dot.

generate_doc_modules.normalize_excludes(rootpath, excludes)

Normalize the excluded directory list: * must be either an absolute path or start with rootpath, * otherwise it is joined with rootpath * with trailing slash

generate_doc_modules.recurse_tree(path, excludes, opts)

Look for every file in the directory tree and create the corresponding ReST files.

generate_doc_modules.shall_skip(module)

Check if we want to skip this module.

generate_doc_modules.write_file(name, text, opts)

Write the output file for module/package <name>.