buildframework/helium/external/python/lib/common/Sphinx-0.5.1-py2.5.egg/sphinx/quickstart.py
author wbernard
Wed, 23 Dec 2009 19:29:07 +0200
changeset 179 d8ac696cc51f
permissions -rw-r--r--
helium_7.0-r14027
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     1
# -*- coding: utf-8 -*-
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     2
"""
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     3
    sphinx.quickstart
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     4
    ~~~~~~~~~~~~~~~~~
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     5
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     6
    Quickly setup documentation source to work with Sphinx.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     7
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     8
    :copyright: 2008 by Georg Brandl.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     9
    :license: BSD.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    10
"""
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    11
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    12
import sys, os, time
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    13
from os import path
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    14
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    15
TERM_ENCODING = getattr(sys.stdin, 'encoding', None)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    16
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    17
from sphinx.util import make_filename
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    18
from sphinx.util.console import purple, bold, red, turquoise, nocolor, color_terminal
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    19
from sphinx.util.texescape import tex_escape_map
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    20
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    21
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    22
PROMPT_PREFIX = '> '
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    23
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    24
QUICKSTART_CONF = '''\
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    25
# -*- coding: utf-8 -*-
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    26
#
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    27
# %(project)s documentation build configuration file, created by
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    28
# sphinx-quickstart on %(now)s.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    29
#
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    30
# This file is execfile()d with the current directory set to its containing dir.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    31
#
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    32
# The contents of this file are pickled, so don't put values in the namespace
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    33
# that aren't pickleable (module imports are okay, they're removed automatically).
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    34
#
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    35
# Note that not all possible configuration values are present in this
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    36
# autogenerated file.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    37
#
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    38
# All configuration values have a default; values that are commented out
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    39
# serve to show the default.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    40
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    41
import sys, os
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    42
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    43
# If your extensions are in another directory, add it here. If the directory
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    44
# is relative to the documentation root, use os.path.abspath to make it
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    45
# absolute, like shown here.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    46
#sys.path.append(os.path.abspath('.'))
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    47
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    48
# General configuration
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    49
# ---------------------
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    50
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    51
# Add any Sphinx extension module names here, as strings. They can be extensions
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    52
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    53
extensions = [%(extensions)s]
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    54
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    55
# Add any paths that contain templates here, relative to this directory.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    56
templates_path = ['%(dot)stemplates']
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    57
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    58
# The suffix of source filenames.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    59
source_suffix = '%(suffix)s'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    60
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    61
# The encoding of source files.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    62
#source_encoding = 'utf-8'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    63
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    64
# The master toctree document.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    65
master_doc = '%(master)s'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    66
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    67
# General information about the project.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    68
project = u'%(project)s'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    69
copyright = u'%(copyright)s'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    70
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    71
# The version info for the project you're documenting, acts as replacement for
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    72
# |version| and |release|, also used in various other places throughout the
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    73
# built documents.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    74
#
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    75
# The short X.Y version.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    76
version = '%(version)s'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    77
# The full version, including alpha/beta/rc tags.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    78
release = '%(release)s'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    79
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    80
# The language for content autogenerated by Sphinx. Refer to documentation
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    81
# for a list of supported languages.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    82
#language = None
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    83
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    84
# There are two options for replacing |today|: either, you set today to some
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    85
# non-false value, then it is used:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    86
#today = ''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    87
# Else, today_fmt is used as the format for a strftime call.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    88
#today_fmt = '%%B %%d, %%Y'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    89
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    90
# List of documents that shouldn't be included in the build.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    91
#unused_docs = []
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    92
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    93
# List of directories, relative to source directory, that shouldn't be searched
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    94
# for source files.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    95
exclude_trees = [%(exclude_trees)s]
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    96
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    97
# The reST default role (used for this markup: `text`) to use for all documents.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    98
#default_role = None
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    99
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   100
# If true, '()' will be appended to :func: etc. cross-reference text.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   101
#add_function_parentheses = True
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   102
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   103
# If true, the current module name will be prepended to all description
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   104
# unit titles (such as .. function::).
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   105
#add_module_names = True
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   106
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   107
# If true, sectionauthor and moduleauthor directives will be shown in the
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   108
# output. They are ignored by default.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   109
#show_authors = False
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   110
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   111
# The name of the Pygments (syntax highlighting) style to use.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   112
pygments_style = 'sphinx'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   113
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   114
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   115
# Options for HTML output
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   116
# -----------------------
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   117
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   118
# The style sheet to use for HTML and HTML Help pages. A file of that name
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   119
# must exist either in Sphinx' static/ path, or in one of the custom paths
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   120
# given in html_static_path.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   121
html_style = 'default.css'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   122
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   123
# The name for this set of Sphinx documents.  If None, it defaults to
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   124
# "<project> v<release> documentation".
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   125
#html_title = None
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   126
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   127
# A shorter title for the navigation bar.  Default is the same as html_title.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   128
#html_short_title = None
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   129
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   130
# The name of an image file (relative to this directory) to place at the top
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   131
# of the sidebar.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   132
#html_logo = None
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   133
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   134
# The name of an image file (within the static path) to use as favicon of the
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   135
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   136
# pixels large.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   137
#html_favicon = None
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   138
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   139
# Add any paths that contain custom static files (such as style sheets) here,
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   140
# relative to this directory. They are copied after the builtin static files,
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   141
# so a file named "default.css" will overwrite the builtin "default.css".
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   142
html_static_path = ['%(dot)sstatic']
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   143
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   144
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   145
# using the given strftime format.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   146
#html_last_updated_fmt = '%%b %%d, %%Y'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   147
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   148
# If true, SmartyPants will be used to convert quotes and dashes to
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   149
# typographically correct entities.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   150
#html_use_smartypants = True
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   151
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   152
# Custom sidebar templates, maps document names to template names.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   153
#html_sidebars = {}
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   154
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   155
# Additional templates that should be rendered to pages, maps page names to
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   156
# template names.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   157
#html_additional_pages = {}
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   158
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   159
# If false, no module index is generated.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   160
#html_use_modindex = True
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   161
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   162
# If false, no index is generated.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   163
#html_use_index = True
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   164
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   165
# If true, the index is split into individual pages for each letter.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   166
#html_split_index = False
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   167
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   168
# If true, the reST sources are included in the HTML build as _sources/<name>.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   169
#html_copy_source = True
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   170
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   171
# If true, an OpenSearch description file will be output, and all pages will
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   172
# contain a <link> tag referring to it.  The value of this option must be the
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   173
# base URL from which the finished HTML is served.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   174
#html_use_opensearch = ''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   175
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   176
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   177
#html_file_suffix = ''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   178
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   179
# Output file base name for HTML help builder.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   180
htmlhelp_basename = '%(project_fn)sdoc'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   181
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   182
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   183
# Options for LaTeX output
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   184
# ------------------------
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   185
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   186
# The paper size ('letter' or 'a4').
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   187
#latex_paper_size = 'letter'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   188
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   189
# The font size ('10pt', '11pt' or '12pt').
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   190
#latex_font_size = '10pt'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   191
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   192
# Grouping the document tree into LaTeX files. List of tuples
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   193
# (source start file, target name, title, author, document class [howto/manual]).
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   194
latex_documents = [
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   195
  ('%(master)s', '%(project_fn)s.tex', ur'%(project_doc_texescaped)s',
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   196
   ur'%(author_texescaped)s', 'manual'),
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   197
]
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   198
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   199
# The name of an image file (relative to this directory) to place at the top of
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   200
# the title page.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   201
#latex_logo = None
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   202
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   203
# For "manual" documents, if this is true, then toplevel headings are parts,
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   204
# not chapters.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   205
#latex_use_parts = False
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   206
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   207
# Additional stuff for the LaTeX preamble.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   208
#latex_preamble = ''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   209
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   210
# Documents to append as an appendix to all manuals.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   211
#latex_appendices = []
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   212
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   213
# If false, no module index is generated.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   214
#latex_use_modindex = True
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   215
'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   216
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   217
INTERSPHINX_CONFIG = '''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   218
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   219
# Example configuration for intersphinx: refer to the Python standard library.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   220
intersphinx_mapping = {'http://docs.python.org/dev': None}
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   221
'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   222
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   223
MASTER_FILE = '''\
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   224
.. %(project)s documentation master file, created by sphinx-quickstart on %(now)s.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   225
   You can adapt this file completely to your liking, but it should at least
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   226
   contain the root `toctree` directive.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   227
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   228
Welcome to %(project)s's documentation!
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   229
===========%(underline)s=================
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   230
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   231
Contents:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   232
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   233
.. toctree::
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   234
   :maxdepth: 2
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   235
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   236
Indices and tables
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   237
==================
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   238
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   239
* :ref:`genindex`
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   240
* :ref:`modindex`
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   241
* :ref:`search`
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   242
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   243
'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   244
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   245
MAKEFILE = '''\
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   246
# Makefile for Sphinx documentation
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   247
#
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   248
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   249
# You can set these variables from the command line.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   250
SPHINXOPTS    =
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   251
SPHINXBUILD   = sphinx-build
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   252
PAPER         =
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   253
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   254
# Internal variables.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   255
PAPEROPT_a4     = -D latex_paper_size=a4
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   256
PAPEROPT_letter = -D latex_paper_size=letter
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   257
ALLSPHINXOPTS   = -d %(rbuilddir)s/doctrees $(PAPEROPT_$(PAPER)) \
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   258
$(SPHINXOPTS) %(rsrcdir)s
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   259
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   260
.PHONY: help clean html web pickle htmlhelp latex changes linkcheck
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   261
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   262
help:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   263
\t@echo "Please use \\`make <target>' where <target> is one of"
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   264
\t@echo "  html      to make standalone HTML files"
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   265
\t@echo "  pickle    to make pickle files"
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   266
\t@echo "  json      to make JSON files"
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   267
\t@echo "  htmlhelp  to make HTML files and a HTML help project"
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   268
\t@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   269
\t@echo "  changes   to make an overview over all changed/added/deprecated items"
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   270
\t@echo "  linkcheck to check all external links for integrity"
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   271
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   272
clean:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   273
\t-rm -rf %(rbuilddir)s/*
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   274
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   275
html:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   276
\tmkdir -p %(rbuilddir)s/html %(rbuilddir)s/doctrees
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   277
\t$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) %(rbuilddir)s/html
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   278
\t@echo
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   279
\t@echo "Build finished. The HTML pages are in %(rbuilddir)s/html."
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   280
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   281
pickle:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   282
\tmkdir -p %(rbuilddir)s/pickle %(rbuilddir)s/doctrees
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   283
\t$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) %(rbuilddir)s/pickle
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   284
\t@echo
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   285
\t@echo "Build finished; now you can process the pickle files."
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   286
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   287
web: pickle
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   288
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   289
json:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   290
\tmkdir -p %(rbuilddir)s/json %(rbuilddir)s/doctrees
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   291
\t$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) %(rbuilddir)s/json
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   292
\t@echo
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   293
\t@echo "Build finished; now you can process the JSON files."
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   294
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   295
htmlhelp:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   296
\tmkdir -p %(rbuilddir)s/htmlhelp %(rbuilddir)s/doctrees
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   297
\t$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) %(rbuilddir)s/htmlhelp
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   298
\t@echo
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   299
\t@echo "Build finished; now you can run HTML Help Workshop with the" \\
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   300
\t      ".hhp project file in %(rbuilddir)s/htmlhelp."
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   301
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   302
latex:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   303
\tmkdir -p %(rbuilddir)s/latex %(rbuilddir)s/doctrees
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   304
\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) %(rbuilddir)s/latex
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   305
\t@echo
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   306
\t@echo "Build finished; the LaTeX files are in %(rbuilddir)s/latex."
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   307
\t@echo "Run \\`make all-pdf' or \\`make all-ps' in that directory to" \\
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   308
\t      "run these through (pdf)latex."
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   309
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   310
changes:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   311
\tmkdir -p %(rbuilddir)s/changes %(rbuilddir)s/doctrees
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   312
\t$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) %(rbuilddir)s/changes
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   313
\t@echo
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   314
\t@echo "The overview file is in %(rbuilddir)s/changes."
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   315
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   316
linkcheck:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   317
\tmkdir -p %(rbuilddir)s/linkcheck %(rbuilddir)s/doctrees
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   318
\t$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) %(rbuilddir)s/linkcheck
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   319
\t@echo
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   320
\t@echo "Link check complete; look for any errors in the above output " \\
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   321
\t      "or in %(rbuilddir)s/linkcheck/output.txt."
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   322
'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   323
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   324
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   325
def mkdir_p(dir):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   326
    if path.isdir(dir):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   327
        return
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   328
    os.makedirs(dir)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   329
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   330
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   331
def is_path(x):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   332
    """Please enter a valid path name."""
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   333
    return path.isdir(x) or not path.exists(x)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   334
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   335
def nonempty(x):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   336
    """Please enter some text."""
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   337
    return len(x)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   338
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   339
def choice(*l):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   340
    def val(x):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   341
        return x in l
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   342
    val.__doc__ = 'Please enter one of %s.' % ', '.join(l)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   343
    return val
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   344
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   345
def boolean(x):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   346
    """Please enter either 'y' or 'n'."""
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   347
    return x.upper() in ('Y', 'YES', 'N', 'NO')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   348
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   349
def suffix(x):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   350
    """Please enter a file suffix, e.g. '.rst' or '.txt'."""
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   351
    return x[0:1] == '.' and len(x) > 1
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   352
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   353
def ok(x):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   354
    return True
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   355
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   356
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   357
def do_prompt(d, key, text, default=None, validator=nonempty):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   358
    while True:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   359
        if default:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   360
            prompt = purple(PROMPT_PREFIX + '%s [%s]: ' % (text, default))
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   361
        else:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   362
            prompt = purple(PROMPT_PREFIX + text + ': ')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   363
        x = raw_input(prompt)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   364
        if default and not x:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   365
            x = default
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   366
        if x.decode('ascii', 'replace').encode('ascii', 'replace') != x:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   367
            if TERM_ENCODING:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   368
                x = x.decode(TERM_ENCODING)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   369
            else:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   370
                print turquoise('* Note: non-ASCII characters entered and terminal '
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   371
                                'encoding unknown -- assuming UTF-8 or Latin-1.')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   372
                try:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   373
                    x = x.decode('utf-8')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   374
                except UnicodeDecodeError:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   375
                    x = x.decode('latin1')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   376
        if validator and not validator(x):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   377
            print red('* ' + validator.__doc__)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   378
            continue
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   379
        break
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   380
    d[key] = x
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   381
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   382
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   383
def inner_main(args):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   384
    d = {}
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   385
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   386
    if not sys.stdout.isatty() or not color_terminal():
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   387
        nocolor()
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   388
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   389
    print bold('Welcome to the Sphinx quickstart utility.')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   390
    print '''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   391
Please enter values for the following settings (just press Enter to
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   392
accept a default value, if one is given in brackets).'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   393
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   394
    print '''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   395
Enter the root path for documentation.'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   396
    do_prompt(d, 'path', 'Root path for the documentation', '.', is_path)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   397
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   398
    while path.isfile(path.join(d['path'], 'conf.py')) or \
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   399
          path.isfile(path.join(d['path'], 'source', 'conf.py')):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   400
        print
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   401
        print bold('Error: an existing conf.py has been found in the '
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   402
                   'selected root path.')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   403
        print 'sphinx-quickstart will not overwrite existing Sphinx projects.'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   404
        print
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   405
        do_prompt(d, 'path', 'Please enter a new root path (or just Enter to exit)',
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   406
                  '', is_path)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   407
        if not d['path']:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   408
            sys.exit(1)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   409
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   410
    print '''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   411
You have two options for placing the build directory for Sphinx output.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   412
Either, you use a directory ".build" within the root path, or you separate
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   413
"source" and "build" directories within the root path.'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   414
    do_prompt(d, 'sep', 'Separate source and build directories (y/N)', 'n',
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   415
              boolean)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   416
    print '''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   417
Inside the root directory, two more directories will be created; ".templates"
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   418
for custom HTML templates and ".static" for custom stylesheets and other
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   419
static files. Since the leading dot may be inconvenient for Windows users,
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   420
you can enter another prefix (such as "_") to replace the dot.'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   421
    do_prompt(d, 'dot', 'Name prefix for templates and static dir', '.', ok)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   422
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   423
    print '''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   424
The project name will occur in several places in the built documentation.'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   425
    do_prompt(d, 'project', 'Project name')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   426
    do_prompt(d, 'author', 'Author name(s)')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   427
    print '''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   428
Sphinx has the notion of a "version" and a "release" for the
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   429
software. Each version can have multiple releases. For example, for
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   430
Python the version is something like 2.5 or 3.0, while the release is
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   431
something like 2.5.1 or 3.0a1.  If you don't need this dual structure,
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   432
just set both to the same value.'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   433
    do_prompt(d, 'version', 'Project version')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   434
    do_prompt(d, 'release', 'Project release', d['version'])
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   435
    print '''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   436
The file name suffix for source files. Commonly, this is either ".txt"
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   437
or ".rst".  Only files with this suffix are considered documents.'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   438
    do_prompt(d, 'suffix', 'Source file suffix', '.rst', suffix)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   439
    print '''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   440
One document is special in that it is considered the top node of the
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   441
"contents tree", that is, it is the root of the hierarchical structure
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   442
of the documents. Normally, this is "index", but if your "index"
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   443
document is a custom template, you can also set this to another filename.'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   444
    do_prompt(d, 'master', 'Name of your master document (without suffix)',
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   445
              'index')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   446
    print '''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   447
Please indicate if you want to use one of the following Sphinx extensions:'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   448
    do_prompt(d, 'ext_autodoc', 'autodoc: automatically insert docstrings '
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   449
              'from modules (y/N)', 'n', boolean)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   450
    do_prompt(d, 'ext_doctest', 'doctest: automatically test code snippets '
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   451
              'in doctest blocks (y/N)', 'n', boolean)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   452
    do_prompt(d, 'ext_intersphinx', 'intersphinx: link between Sphinx documentation '
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   453
              'of different projects (y/N)', 'n', boolean)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   454
    print '''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   455
If you are under Unix, a Makefile can be generated for you so that you
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   456
only have to run e.g. `make html' instead of invoking sphinx-build
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   457
directly.'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   458
    do_prompt(d, 'makefile', 'Create Makefile? (Y/n)',
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   459
              os.name == 'posix' and 'y' or 'n', boolean)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   460
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   461
    d['project_fn'] = make_filename(d['project'])
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   462
    d['now'] = time.asctime()
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   463
    d['underline'] = len(d['project']) * '='
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   464
    d['extensions'] = ', '.join(
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   465
        repr('sphinx.ext.' + name) for name in ('autodoc', 'doctest', 'intersphinx')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   466
        if d['ext_' + name].upper() in ('Y', 'YES'))
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   467
    d['copyright'] = time.strftime('%Y') + ', ' + d['author']
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   468
    d['author_texescaped'] = unicode(d['author']).translate(tex_escape_map)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   469
    d['project_doc'] = d['project'] + ' Documentation'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   470
    d['project_doc_texescaped'] = \
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   471
        unicode(d['project'] + ' Documentation').translate(tex_escape_map)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   472
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   473
    if not path.isdir(d['path']):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   474
        mkdir_p(d['path'])
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   475
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   476
    separate = d['sep'].upper() in ('Y', 'YES')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   477
    srcdir = separate and path.join(d['path'], 'source') or d['path']
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   478
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   479
    mkdir_p(srcdir)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   480
    if separate:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   481
        builddir = path.join(d['path'], 'build')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   482
        d['exclude_trees'] = ''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   483
    else:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   484
        builddir = path.join(srcdir, d['dot'] + 'build')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   485
        d['exclude_trees'] = repr(d['dot'] + 'build')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   486
    mkdir_p(builddir)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   487
    mkdir_p(path.join(srcdir, d['dot'] + 'templates'))
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   488
    mkdir_p(path.join(srcdir, d['dot'] + 'static'))
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   489
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   490
    conf_text = QUICKSTART_CONF % d
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   491
    if d['ext_intersphinx'].upper() in ('Y', 'YES'):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   492
        conf_text += INTERSPHINX_CONFIG
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   493
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   494
    f = open(path.join(srcdir, 'conf.py'), 'w')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   495
    f.write(conf_text.encode('utf-8'))
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   496
    f.close()
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   497
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   498
    masterfile = path.join(srcdir, d['master'] + d['suffix'])
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   499
    f = open(masterfile, 'w')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   500
    f.write((MASTER_FILE % d).encode('utf-8'))
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   501
    f.close()
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   502
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   503
    create_makefile = d['makefile'].upper() in ('Y', 'YES')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   504
    if create_makefile:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   505
        d['rsrcdir'] = separate and 'source' or '.'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   506
        d['rbuilddir'] = separate and 'build' or d['dot'] + 'build'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   507
        f = open(path.join(d['path'], 'Makefile'), 'w')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   508
        f.write((MAKEFILE % d).encode('utf-8'))
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   509
        f.close()
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   510
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   511
    print
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   512
    print bold('Finished: An initial directory structure has been created.')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   513
    print '''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   514
You should now populate your master file %s and create other documentation
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   515
source files. ''' % masterfile + (create_makefile and '''\
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   516
Use the Makefile to build the docs, like so:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   517
   make builder
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   518
''' or '''\
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   519
Use the sphinx-build command to build the docs, like so:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   520
   sphinx-build -b builder %s %s
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   521
''' % (srcdir, builddir)) + '''\
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   522
where "builder" is one of the supported builders, e.g. html, latex or linkcheck.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   523
'''
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   524
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   525
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   526
def main(argv=sys.argv):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   527
    try:
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   528
        return inner_main(argv)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   529
    except (KeyboardInterrupt, EOFError):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   530
        print
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   531
        print '[Interrupted.]'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   532
        return
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
   533