3
T'íc´ ã @ s d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m
Z
mZ ddlm
Z
ddlmZ dd lmZmZ dd
lmZmZ ddlmZ G dd
d
eZdS )zSetuptools/distutils commands to assist the building of sphinx documentation.
:author: Sebastian Wiesner <basti.wiesner@gmx.net>
é N)ÚCommand)ÚDistutilsExecError)ÚStringIO)ÚAnyÚDict)ÚSphinx)Úhandle_exception)Úcolor_terminalÚnocolor)Údocutils_namespaceÚpatch_docutils)Úabspathc @ s e Zd ZdZdZd8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHgZdddd d*gZd
d/d0d1Zed/d2d3Z d
d/d4d5Z
d
d/d6d7Zd
S )IÚBuildDoca9
Distutils command to build Sphinx documentation.
The Sphinx build can then be triggered from distutils, and some Sphinx
options can be set in ``setup.py`` or ``setup.cfg`` instead of Sphinx's
own configuration file.
For instance, from `setup.py`::
# this is only necessary when not using setuptools/distribute
from sphinx.setup_command import BuildDoc
cmdclass = {'build_sphinx': BuildDoc}
name = 'My project'
version = '1.2'
release = '1.2.0'
setup(
name=name,
author='Bernard Montgomery',
version=release,
cmdclass=cmdclass,
# these are optional and override conf.py settings
command_options={
'build_sphinx': {
'project': ('setup.py', name),
'version': ('setup.py', version),
'release': ('setup.py', release)}},
)
Or add this section in ``setup.cfg``::
[build_sphinx]
project = 'My project'
version = 1.2
release = 1.2.0
zBuild Sphinx documentationú fresh-envÚEúdiscard saved environmentú all-filesÚaúbuild all filesúsource-dir=ÚsúSource directoryú
build-dir=NúBuild directoryúconfig-dir=Úcú'Location of the configuration directoryúbuilder=Úbú]The builder (or builders) to use. Can be a comma- or space-separated list. Defaults to "html"úwarning-is-errorÚWúTurn warning into errorsúproject=úThe documented project's nameúversion=úThe short X.Y versionúrelease=ú.The full version, including alpha/beta/rc tagsútoday=úCHow to format the current date, used as the replacement for |today|ú
link-indexÚiú!Link index.html to the master docÚ copyrightúThe copyright stringÚpdbúStart pdb on exceptionÚ verbosityÚvú$increase verbosity (can be repeated)ÚnitpickyÚnú1nit-picky mode, warn about all missing referencesú
keep-goingú)With -W, keep going when getting warnings)Úreturnc C sx d | _ | _d| _d | _d | _d| _d| _d| _d| _d| _ d| _
d | _d| _d| _
| jjd | _d| _d| _d| _d S )NFÚhtmlÚ é )Ú fresh_envÚ all_filesr0 Ú
source_dirÚ build_dirÚbuilderÚwarning_is_errorÚprojectÚversionÚreleaseÚtodayÚ
config_dirÚ
link_indexr. ÚdistributionÚverboser2 Ú tracebackr5 Ú
keep_going)Úself© rO ú6/tmp/pip-build-gk9425m9/sphinx/sphinx/setup_command.pyÚinitialize_optionsS s"