conf.py 13.9 KB
Newer Older
Gabriel Gellner's avatar
Gabriel Gellner committed
1 2 3
# -*- coding: utf-8 -*-
#
# Cython documentation build configuration file, created by
Stefan Behnel's avatar
Stefan Behnel committed
4
# sphinx-quickstart on Sun Jun 29 13:36:38 2014.
Gabriel Gellner's avatar
Gabriel Gellner committed
5 6 7
#
# This file is execfile()d with the current directory set to its containing dir.
#
Stefan Behnel's avatar
Stefan Behnel committed
8 9
# Note that not all possible configuration values are present in this
# autogenerated file.
Gabriel Gellner's avatar
Gabriel Gellner committed
10
#
Stefan Behnel's avatar
Stefan Behnel committed
11 12
# All configuration values have a default; values that are commented out
# serve to show the default.
Gabriel Gellner's avatar
Gabriel Gellner committed
13

Stefan Behnel's avatar
Stefan Behnel committed
14
import sys, os, os.path, re
15
import itertools
Stefan Behnel's avatar
Stefan Behnel committed
16 17 18
import datetime

YEAR = datetime.date.today().strftime('%Y')
Gabriel Gellner's avatar
Gabriel Gellner committed
19

Stefan Behnel's avatar
Stefan Behnel committed
20 21 22 23 24
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.append(os.path.abspath('sphinxext'))
25 26 27 28 29

# Import support for ipython console session syntax highlighting (lives
# in the sphinxext directory defined above)
import ipython_console_highlighting

Stefan Behnel's avatar
Stefan Behnel committed
30
# -- General configuration -----------------------------------------------------
Gabriel Gellner's avatar
Gabriel Gellner committed
31

32 33 34 35
# Use cython as the default syntax highlighting language, as python is a subset
# this does the right thing
highlight_language = 'cython'

Stefan Behnel's avatar
Stefan Behnel committed
36 37 38
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

Gabriel Gellner's avatar
Gabriel Gellner committed
39 40
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
41 42 43 44 45 46 47 48 49 50 51
extensions = [
    'ipython_console_highlighting',
    'cython_highlighting',
    'sphinx.ext.pngmath',
    'sphinx.ext.todo',
    'sphinx.ext.intersphinx'
    ]

try: import rst2pdf
except ImportError: pass
else: extensions.append('rst2pdf.pdfbuilder')
Gabriel Gellner's avatar
Gabriel Gellner committed
52 53

# Add any paths that contain templates here, relative to this directory.
54
templates_path = ['_templates']
Gabriel Gellner's avatar
Gabriel Gellner committed
55 56 57 58

# The suffix of source filenames.
source_suffix = '.rst'

Stefan Behnel's avatar
Stefan Behnel committed
59 60 61
# The encoding of source files.
#source_encoding = 'utf-8-sig'

Gabriel Gellner's avatar
Gabriel Gellner committed
62 63 64
# The master toctree document.
master_doc = 'index'

65 66
exclude_patterns = ['py*', 'build']

Stefan Behnel's avatar
Stefan Behnel committed
67
# General information about the project.
Gabriel Gellner's avatar
Gabriel Gellner committed
68
project = 'Cython'
Stefan Behnel's avatar
Stefan Behnel committed
69
authors = 'Stefan Behnel, Robert Bradshaw, Dag Sverre Seljebotn, Greg Ewing, William Stein, Gabriel Gellner, et al.'
Stefan Behnel's avatar
Stefan Behnel committed
70
copyright = '%s, %s' % (YEAR, authors)
Gabriel Gellner's avatar
Gabriel Gellner committed
71

Stefan Behnel's avatar
Stefan Behnel committed
72 73 74
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
Gabriel Gellner's avatar
Gabriel Gellner committed
75 76
#
# The full version, including alpha/beta/rc tags.
77
release = '0.15'
78 79
try:
    _match_version = re.compile(r'^\s*_*version\s*_*\s*=\s*["\']([^"\']+)["\'].*').match
80
    with open(os.path.join(os.path.dirname(__file__), '..', 'Cython', 'Shadow.py')) as _f:
81
        for line in itertools.islice(_f, 5):  # assume version comes early enough
82 83 84 85
            _m = _match_version(line)
            if _m:
                release = _m.group(1)
                break
86 87
        else:
            print("FAILED TO PARSE PROJECT VERSION !")
88 89 90 91
except:
    pass
# The short X.Y version.
version = re.sub('^([0-9]+[.][0-9]+).*', '\g<1>', release)
Gabriel Gellner's avatar
Gabriel Gellner committed
92

Stefan Behnel's avatar
Stefan Behnel committed
93 94 95 96
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

Gabriel Gellner's avatar
Gabriel Gellner committed
97 98 99 100 101 102
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%B %d, %Y'

Stefan Behnel's avatar
Stefan Behnel committed
103 104 105 106 107 108
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []

# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
Gabriel Gellner's avatar
Gabriel Gellner committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

Stefan Behnel's avatar
Stefan Behnel committed
124 125 126 127 128 129 130
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []

# todo
todo_include_todos = True

# intersphinx for standard :keyword:s (def, for, etc.)
Stefan Behnel's avatar
Stefan Behnel committed
131 132 133 134
intersphinx_mapping = {'python': ('http://docs.python.org/3/', None)}

# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
Stefan Behnel's avatar
Stefan Behnel committed
135 136 137


# -- Options for HTML output ---------------------------------------------------
Gabriel Gellner's avatar
Gabriel Gellner committed
138

Stefan Behnel's avatar
Stefan Behnel committed
139 140
# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
141 142 143 144 145 146 147
html_theme = 'default'
try:
    import sphinx
    if os.path.isdir(os.path.join(os.path.dirname(sphinx.__file__), 'themes', 'nature')):
        html_theme = 'nature'
except (ImportError, AttributeError):
    pass  # use default theme
148

Stefan Behnel's avatar
Stefan Behnel committed
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []

# The name for this set of Sphinx documents.  If None, it defaults to
# "<project> v<release> documentation".
#html_title = None

# A shorter title for the navigation bar.  Default is the same as html_title.
#html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
166
html_logo = "_static/cythonlogo.png"
Stefan Behnel's avatar
Stefan Behnel committed
167 168 169 170

# The name of an image file (within the static path) to use as favicon of the
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
171
html_favicon = "_static/favicon.ico"
Gabriel Gellner's avatar
Gabriel Gellner committed
172 173 174 175

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
176
html_static_path = ['_static']
Gabriel Gellner's avatar
Gabriel Gellner committed
177 178 179

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Stefan Behnel's avatar
Stefan Behnel committed
180
#html_last_updated_fmt = '%b %d, %Y'
181

Gabriel Gellner's avatar
Gabriel Gellner committed
182 183 184 185 186 187 188 189 190 191 192 193
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}

# If false, no module index is generated.
Stefan Behnel's avatar
Stefan Behnel committed
194
html_domain_indices = False
195

Stefan Behnel's avatar
Stefan Behnel committed
196
# If false, no index is generated.
197
html_use_index = False
Gabriel Gellner's avatar
Gabriel Gellner committed
198

Stefan Behnel's avatar
Stefan Behnel committed
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
# If true, the index is split into individual pages for each letter.
#html_split_index = False

# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it.  The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
Gabriel Gellner's avatar
Gabriel Gellner committed
218 219 220 221 222

# Output file base name for HTML help builder.
htmlhelp_basename = 'Cythondoc'


Stefan Behnel's avatar
Stefan Behnel committed
223
# -- Options for LaTeX output --------------------------------------------------
Gabriel Gellner's avatar
Gabriel Gellner committed
224

Stefan Behnel's avatar
Stefan Behnel committed
225 226 227
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
Gabriel Gellner's avatar
Gabriel Gellner committed
228 229

# The font size ('10pt', '11pt' or '12pt').
Stefan Behnel's avatar
Stefan Behnel committed
230 231 232 233 234
#'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
Gabriel Gellner's avatar
Gabriel Gellner committed
235 236

# Grouping the document tree into LaTeX files. List of tuples
Stefan Behnel's avatar
Stefan Behnel committed
237
# (source start file, target name, title, author, documentclass [howto/manual]).
Gabriel Gellner's avatar
Gabriel Gellner committed
238 239
_stdauthor = r'Stefan Behnel, Robert Bradshaw, William Stein\\ Gary Furnish, Dag Seljebotn, Greg Ewing\\ Gabriel Gellner, editor'
latex_documents = [
240 241 242 243
    ('src/reference/index', 'reference.tex',
     'Cython Reference Guide', _stdauthor, 'manual'),
    ('src/tutorial/index', 'tutorial.tex',
     'Cython Tutorial', _stdauthor, 'manual')
Gabriel Gellner's avatar
Gabriel Gellner committed
244 245
]

Stefan Behnel's avatar
Stefan Behnel committed
246 247 248 249 250 251 252 253 254 255 256 257 258
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False

# If true, show page references after internal links.
#latex_show_pagerefs = False

# If true, show URL addresses after external links.
#latex_show_urls = False
Gabriel Gellner's avatar
Gabriel Gellner committed
259 260 261 262 263

# Documents to append as an appendix to all manuals.
#latex_appendices = []

# If false, no module index is generated.
Stefan Behnel's avatar
Stefan Behnel committed
264
#latex_domain_indices = True
265

266

Stefan Behnel's avatar
Stefan Behnel committed
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
# -- Options for manual page output --------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
    ('index', 'cython', u'Cython Documentation',
     [authors], 1)
]

# If true, show URL addresses after external links.
#man_show_urls = False


# -- Options for Texinfo output ------------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
#  dir menu entry, description, category)
texinfo_documents = [
  ('index', 'Cython', u'Cython Documentation',
   authors, 'Cython', 'One line description of project.',
   'Miscellaneous'),
]

# Documents to append as an appendix to all manuals.
#texinfo_appendices = []

# If false, no module index is generated.
#texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'

Stefan Behnel's avatar
Stefan Behnel committed
300 301 302
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False

Stefan Behnel's avatar
Stefan Behnel committed
303 304 305 306 307 308 309

# -- Options for Epub output ---------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = u'Cython'
epub_author = authors
epub_publisher = u''
Stefan Behnel's avatar
Stefan Behnel committed
310
epub_copyright = copyright
Stefan Behnel's avatar
Stefan Behnel committed
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328

# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''

# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''

# A unique identification for the text.
#epub_uid = ''

# A tuple containing the cover image and cover page html template filenames.
#epub_cover = ()

Stefan Behnel's avatar
Stefan Behnel committed
329 330 331
# A sequence of (type, uri, title) tuples for the guide element of content.opf.
#epub_guide = ()

Stefan Behnel's avatar
Stefan Behnel committed
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348
# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []

# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_post_files = []

# A list of files that should not be packed into the epub file.
#epub_exclude_files = []

# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3

# Allow duplicate toc entries.
#epub_tocdup = True

Stefan Behnel's avatar
Stefan Behnel committed
349 350 351 352 353 354 355 356 357 358 359 360 361
# Fix unsupported image types using the PIL.
#epub_fix_images = False

# Scale large images.
#epub_max_image_width = 0

# If 'no', URL addresses will not be shown.
#epub_show_urls = 'inline'

# If false, no index is generated.
#epub_use_index = True


Stefan Behnel's avatar
Stefan Behnel committed
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458
# -- Options for PDF output --------------------------------------------------

# Grouping the document tree into PDF files. List of tuples
# (source start file, target name, title, author, options).
#
# If there is more than one author, separate them with \\.
# For example: r'Guido van Rossum\\Fred L. Drake, Jr., editor'
#
# The options element is a dictionary that lets you override
# this config per-document.
# For example,
# ('index', u'MyProject', u'My Project', u'Author Name',
#  dict(pdf_compressed = True))
# would mean that specific document would be compressed
# regardless of the global pdf_compressed setting.

pdf_documents = [
    ('index', project, project, authors.replace(', ', '\\\\')),
]

# A comma-separated list of custom stylesheets. Example:
pdf_stylesheets = ['sphinx','kerning','a4']

# A list of folders to search for stylesheets. Example:
pdf_style_path = ['.', '_styles']

# Create a compressed PDF
# Use True/False or 1/0
# Example: compressed=True
pdf_compressed = True

# A colon-separated list of folders to search for fonts. Example:
# pdf_font_path = ['/usr/share/fonts', '/usr/share/texmf-dist/fonts/']

# Language to be used for hyphenation support
#pdf_language = "en_US"

# Mode for literal blocks wider than the frame. Can be
# overflow, shrink or truncate
pdf_fit_mode = "shrink"

# Section level that forces a break page.
# For example: 1 means top-level sections start in a new page
# 0 means disabled
#pdf_break_level = 0

# When a section starts in a new page, force it to be 'even', 'odd',
# or just use 'any'
#pdf_breakside = 'any'

# Insert footnotes where they are defined instead of
# at the end.
#pdf_inline_footnotes = True

# verbosity level. 0 1 or 2
#pdf_verbosity = 0

# If false, no index is generated.
pdf_use_index = False

# If false, no modindex is generated.
pdf_use_modindex = False

# If false, no coverpage is generated.
#pdf_use_coverpage = True

# Name of the cover page template to use
#pdf_cover_template = 'sphinxcover.tmpl'

# Documents to append as an appendix to all manuals.
#pdf_appendices = []

# Enable experimental feature to split table cells. Use it
# if you get "DelayedTable too big" errors
#pdf_splittables = False

# Set the default DPI for images
#pdf_default_dpi = 72

# Enable rst2pdf extension modules (default is only vectorpdf)
# you need vectorpdf if you want to use sphinx's graphviz support
#pdf_extensions = ['vectorpdf']

# Page template name for "regular" pages
#pdf_page_template = 'cutePage'

# Show Table Of Contents at the beginning?
pdf_use_toc = False

# How many levels deep should the table of contents be?
pdf_toc_depth = 9999

# Add section number to section references
pdf_use_numbered_links = False

# Background images fitting mode
pdf_fit_background_mode = 'scale'