sphinxcontrib-paverutils

Sphinx/Paver integration
Download

sphinxcontrib-paverutils Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Doug Hellmann
  • Publisher web site:
  • http://www.doughellmann.com

sphinxcontrib-paverutils Tags


sphinxcontrib-paverutils Description

Sphinx/Paver integration sphinxcontrib-paverutils is a Python module that provides an alternative integration of Sphinx and Paver. It supports calling Sphinx from within Paver using multiple configurations, and does not assume you only want to build HTML output.Basic UsageTo use this module, import it in your pavement.py file as from sphinxcontrib import paverutils, then define option Bundles for "html" and/or "pdf" output using the options described in the task help.For example:import paverimport paver.misctasksfrom paver.path import pathfrom paver.easy import *import paver.setuputilspaver.setuputils.install_distutils_tasks()try: from sphinxcontrib import paverutilsexcept: import warnings warnings.warn('sphinxcontrib.paverutils was not found, you will not be able to produce documentation')options( setup=Bunch( name = 'MyProject', version = '1.0', # ... more options here ... ), # Defaults for sphinxcontrib.paverutils sphinx = Bunch( docroot='.', sourcedir='docsource', builder='html', ), # One configuration to build HTML for the package html=Bunch( builddir='docs', confdir='sphinx/pkg', ), # Another configuration with different templates # to build HTML to upload to the website website=Bunch( builddir = 'web', confdir='sphinx/web', ), # We also want a PDF file for the website, # so the instructions are included in the web # configuration directory. pdf=Bunch( builddir='web', builder='latex', confdir='sphinx/web', ),)Configuration Parametersdocroot the root under which Sphinx will be working. default: docsbuilddir directory under the docroot where the resulting files are put. default: buildsourcedir directory under the docroot for the source files default: (empty string)doctrees the location of the cached doctrees default: $builddir/doctreesconfdir the location of the sphinx conf.py default: $sourcediroutdir the location of the generated output files default: $builddir/$builderbuilder the name of the sphinx builder to use default: htmltemplate_args dictionary of values to be passed as name-value pairs to the HTML builder default: {}Advanced UsageYou can also develop your own tasks by calling run_sphinx() directly:@task@needs()@cmdopts()def blog(options): """Generate the blog post version of the HTML for the current module. """ # Generate html from sphinx paverutils.run_sphinx(options, 'blog') blog_file = path(options.blog.outdir) / options.blog.out_file dry("Write blog post body to %s" % blog_file, gen_blog_post, outdir=options.blog.outdir, input_base=options.blog.in_file, blog_base=options.blog.out_file, ) if 'EDITOR' in os.environ: sh('$EDITOR %s' % blog_file) return Requirements: · Python What's New in This Release: · Updated to include run_script() function.


sphinxcontrib-paverutils Related Software