def bootstrap(path, name, version, release=None): d = dict(( # root path ("path", path), # separate source and build dirs (bool) ("sep", False), # name prefix for templates and static dir ("dot", ""), # project name ("project", name), # Author name(s) ("author", u"Lionel Dricot & Izidor Matušov"), # Project version, e.g. 2.5 ("version", version or ""), # Project release, e.g. 2.5.1 ("release", release or version or ""), # Source file suffix ("suffix", ".rst"), # master document name (without suffix) ("master", "index"), # Maximum depth of submodules to show in the TOC (int) ("mastertocmaxdepth", 4), # add configuration for epub builder ("epub", False), # automatically insert docstrings from modules (bool) ("ext_autodoc", True), # automatically test code in doctest blocks (bool) ("ext_doctest", False), # link Sphinx docs of different projects (bool) ("ext_intersphinx", False), # write "todo" entries (bool) ("ext_todo", True), # checks for documentation coverage (bool) ("ext_coverage", False), # include math, rendered as PNG images (bool) ("ext_pngmath", False), # include math, rendered in the browser by MathJax (bool) ("ext_mathjax", True), # conditional inclusion of content based on config values (bool) ("ext_ifconfig", False), # include links to the source code of documented Python objects (bool) ("ext_viewcode", True), # create Makefile (bool) ("makefile", False), # create Windows command file (bool) ("batchfile", False), )) if not isdir(path): os.makedirs(path) modules = recurse_tree(name, d) d["mastertoctree"] = create_modules_list(modules) create_modules_toc_file(modules, d) generate(d, silent=True, overwrite=True)
# use apidoc to generate developer doc import os from os import path from sphinx.apidoc import create_modules_toc_file, recurse_tree class Opt(object): pass rootpath = path.abspath(path.join(project_root, "src")) opts = Opt() opts.modulefirst = None opts.separatemodules = None opts.noheadings = None opts.destdir = path.abspath(path.join(project_root, "doc", "_dvlpt")) opts.suffix = source_suffix[1:] opts.dryrun = None opts.force = None opts.header = 'src' opts.maxdepth = 4 opts.includeprivate = False if not path.isdir(opts.destdir): os.makedirs(opts.destdir) modules = recurse_tree(rootpath, [], opts) create_modules_toc_file(modules, opts) # #}
# use apidoc to generate developer doc import os from os import path from sphinx.apidoc import create_modules_toc_file, recurse_tree class Opt(object): pass rootpath = path.abspath(path.join(project_root, "src")) opts = Opt() opts.modulefirst = None opts.separatemodules = None opts.noheadings = None opts.destdir = path.abspath(path.join(project_root, "doc", "_dvlpt")) opts.suffix = source_suffix opts.dryrun = None opts.force = None opts.header = 'src' opts.maxdepth = 4 if not path.isdir(opts.destdir): os.makedirs(opts.destdir) modules = recurse_tree(rootpath, [], opts) create_modules_toc_file(modules, opts) # #}