956d4bc187847f645e8a898e5c55e0945f91485e
[ibg.git] / conf.py
1 # -*- coding: utf-8 -*-
2 #
3 # Inform Beginner's Guide documentation build configuration file, created by
4 # sphinx-quickstart on Tue Mar 29 07:50:39 2016.
5 #
6 # This file is execfile()d with the current directory set to its
7 # containing dir.
8 #
9 # Note that not all possible configuration values are present in this
10 # autogenerated file.
11 #
12 # All configuration values have a default; values that are commented out
13 # serve to show the default.
14
15 import os
16 import sys
17 import string
18 import codecs
19
20 # If extensions (or modules to document with autodoc) are in another directory,
21 # add these directories to sys.path here. If the directory is relative to the
22 # documentation root, use os.path.abspath to make it absolute, like shown here.
23 sys.path.insert(0, ".")
24
25 import tools.sphinxpatch
26
27 from tools.inform import InformLexer
28 from tools.transcript import TranscriptLexer
29
30 # Setup function.
31 def setup(app):
32     app.add_lexer('inform', InformLexer())
33     app.add_lexer('transcript', TranscriptLexer())
34
35 # -- General configuration ------------------------------------------------
36
37 # If your documentation needs a minimal Sphinx version, state it here.
38 #needs_sphinx = '1.0'
39
40 # Add any Sphinx extension module names here, as strings. They can be
41 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
42 # ones.
43 extensions = [
44     'sphinx.ext.todo',
45     'tools.blockdiag',
46 ]
47
48 # Add any paths that contain templates here, relative to this directory.
49 templates_path = ['templates']
50
51 # The suffix(es) of source filenames.
52 source_suffix = ['.rst']
53
54 # The encoding of source files.
55 #source_encoding = 'utf-8-sig'
56
57 # The master toctree document.
58 master_doc = 'index'
59
60 # General document information.
61 project = u"The Inform Beginner's Guide"
62 author = u"Roger Firth and Sonja Kesserich"
63 copyright = u'2004, ' + author
64
65 editor = "Dennis G. Jerz"
66 edition = "Third Edition: August 2004"
67 extra = "With a foreword by Graham Nelson"
68
69 licensetext = codecs.open('LICENSE', encoding='utf-8').read()
70
71 # The version info for the project you're documenting, acts as replacement
72 # for |version| and |release|, also used in various other places throughout
73 # the built documents.
74 #
75 # The short X.Y version.
76 version = '3'
77 # The full version, including alpha/beta/rc tags.
78 release = version
79
80 # The language for content autogenerated by Sphinx. Refer to documentation
81 # for a list of supported languages.
82 #
83 # This is also used if you do content translation via gettext catalogs.
84 # Usually you set "language" from the command line for these cases.
85 language = None
86
87 # There are two options for replacing |today|: either, you set today to some
88 # non-false value, then it is used:
89 #today = ''
90 # Else, today_fmt is used as the format for a strftime call.
91 #today_fmt = '%B %d, %Y'
92
93 # List of patterns, relative to source directory, that match files and
94 # directories to ignore when looking for source files.
95 exclude_patterns = ['config', 'output', 'tables']
96
97 # The reST default role (used for this markup: `text`) to use for all
98 # documents.
99 default_role = "any"
100
101 # If true, '()' will be appended to :func: etc. cross-reference text.
102 #add_function_parentheses = True
103
104 # If true, the current module name will be prepended to all description
105 # unit titles (such as .. function::).
106 #add_module_names = True
107
108 # If true, sectionauthor and moduleauthor directives will be shown in the
109 # output. They are ignored by default.
110 #show_authors = False
111
112 # The name of the Pygments (syntax highlighting) style to use.
113 pygments_style = 'friendly'
114
115 # The default Pygments highlight language.
116 highlight_language = 'none'
117
118 # A list of ignored prefixes for module index sorting.
119 #modindex_common_prefix = []
120
121 # If true, keep warnings as "system message" paragraphs in the built documents.
122 #keep_warnings = False
123
124 # If true, `todo` and `todoList` produce output, else they produce nothing.
125 todo_include_todos = True
126
127
128 # -- Options for HTML output ----------------------------------------------
129
130 # The theme to use for HTML and HTML Help pages.  See the documentation for
131 # a list of builtin themes.
132 html_theme = 'alabaster'
133
134 # Theme options are theme-specific and customize the look and feel of a theme
135 # further.  For a list of options available for each theme, see the
136 # documentation.
137 html_theme_options = {
138     'font_family': 'Georgia',
139     'head_font_family': 'Georgia',
140     'page_width': '1050px',
141     'show_related': True,
142 }
143
144 # Add any paths that contain custom themes here, relative to this directory.
145 #html_theme_path = []
146
147 # The name for this set of Sphinx documents.  If None, it defaults to
148 # "<project> v<release> documentation".
149 html_title = project
150
151 # A shorter title for the navigation bar.  Default is the same as html_title.
152 #html_short_title = None
153
154 # The name of an image file (relative to this directory) to place at the top
155 # of the sidebar.
156 #html_logo = None
157
158 # The name of an image file (within the static path) to use as favicon of the
159 # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
160 # pixels large.
161 #html_favicon = None
162
163 # Add any paths that contain custom static files (such as style sheets) here,
164 # relative to this directory. They are copied after the builtin static files,
165 # so a file named "default.css" will overwrite the builtin "default.css".
166 #html_static_path = ['static']
167
168 # Add any extra paths that contain custom files (such as robots.txt or
169 # .htaccess) here, relative to this directory. These files are copied
170 # directly to the root of the documentation.
171 #html_extra_path = []
172
173 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
174 # using the given strftime format.
175 #html_last_updated_fmt = '%b %d, %Y'
176
177 # If true, SmartyPants will be used to convert quotes and dashes to
178 # typographically correct entities.
179 #html_use_smartypants = True
180
181 # Custom sidebar templates, maps document names to template names.
182 #html_sidebars = {}
183
184 # Additional templates that should be rendered to pages, maps page names to
185 # template names.
186 #html_additional_pages = {}
187
188 # If false, no module index is generated.
189 #html_domain_indices = True
190
191 # If false, no index is generated.
192 #html_use_index = True
193
194 # If true, the index is split into individual pages for each letter.
195 #html_split_index = False
196
197 # If true, links to the reST sources are added to the pages.
198 #html_show_sourcelink = True
199
200 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
201 #html_show_sphinx = True
202
203 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
204 #html_show_copyright = True
205
206 # If true, an OpenSearch description file will be output, and all pages will
207 # contain a <link> tag referring to it.  The value of this option must be the
208 # base URL from which the finished HTML is served.
209 #html_use_opensearch = ''
210
211 # This is the file name suffix for HTML files (e.g. ".xhtml").
212 #html_file_suffix = None
213
214 # Language to be used for generating the HTML full-text search index.
215 # Sphinx supports the following languages:
216 #   'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
217 #   'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
218 #html_search_language = 'en'
219
220 # A dictionary with options for the search language support, empty by default.
221 # Now only 'ja' uses this config value
222 #html_search_options = {'type': 'default'}
223
224 # The name of a javascript file (relative to the configuration directory) that
225 # implements a search results scorer. If empty, the default will be used.
226 #html_search_scorer = 'scorer.js'
227
228 # Output file base name for HTML help builder.
229 htmlhelp_basename = 'IBG'
230
231 # -- Options for LaTeX output ---------------------------------------------
232
233 # Title page information.
234 latex_image = "harry_col"
235 latex_image_title = "First Steps"
236 latex_image_info = "(watercolour and crayon on paper, 2002) Harry Firth (2000-)"
237 latex_image_path = os.path.join('images', latex_image + '.png')
238 latex_additional_files = [latex_image_path]
239
240 template = string.Template(open('config/preamble.tex').read())
241
242 latex_contents = r"""
243 \coverpage
244 \licensepage
245 \historypage
246 \contentspage
247 \newpage
248 \maintext
249 """
250
251 latex_elements = {
252     # The paper size ('letterpaper' or 'a4paper').
253     'papersize': 'a4paper',
254
255     # The font size ('10pt', '11pt' or '12pt').
256     'pointsize': '12pt',
257
258     # Additional stuff for the LaTeX preamble.
259     'preamble': template.substitute(title=project,
260                                     author=author,
261                                     image=latex_image,
262                                     imagetitle=latex_image_title,
263                                     imageinfo=latex_image_info,
264                                     editor=editor,
265                                     edition=edition,
266                                     extra=extra,
267                                     licensetext=licensetext),
268
269     'tableofcontents': latex_contents,
270
271     'fontpkg': '',
272
273     # Latex figure (float) alignment
274     #'figure_align': 'htbp',
275 }
276  
277 # Grouping the document tree into LaTeX files. List of tuples
278 # (source start file, target name, title,
279 #  author, documentclass [howto, manual, or own class]).
280 latex_documents = [
281     (master_doc, 'IBG.tex', project, author, 'howto'),
282 ]
283
284 # The name of an image file (relative to this directory) to place at the top of
285 # the title page.
286 #latex_logo = None
287
288 # For "manual" documents, if this is true, then toplevel headings are parts,
289 # not chapters.
290 #latex_use_parts = False
291
292 # If true, show page references after internal links.
293 latex_show_pagerefs = True
294
295 # If true, show URL addresses after external links.
296 #latex_show_urls = False
297
298 # Documents to append as an appendix to all manuals.
299 #latex_appendices = []
300
301 # If false, no module index is generated.
302 #latex_domain_indices = True
303
304
305 # -- Options for manual page output ---------------------------------------
306
307 # One entry per manual page. List of tuples
308 # (source start file, name, description, authors, manual section).
309 man_pages = [
310     (master_doc, 'IBG', project, [author], 1)
311 ]
312
313 # If true, show URL addresses after external links.
314 #man_show_urls = False
315
316
317 # -- Options for Texinfo output -------------------------------------------
318
319 # Grouping the document tree into Texinfo files. List of tuples
320 # (source start file, target name, title, author,
321 #  dir menu entry, description, category)
322 texinfo_documents = [
323   (master_doc, 'ibg', project,
324    author, project, 'Beginner\'s guide to Inform.',
325    'Games'),
326 ]
327
328 # Documents to append as an appendix to all manuals.
329 #texinfo_appendices = []
330
331 # If false, no module index is generated.
332 #texinfo_domain_indices = True
333
334 # How to display URL addresses: 'footnote', 'no', or 'inline'.
335 #texinfo_show_urls = 'footnote'
336
337 # If true, do not generate a @detailmenu in the "Top" node's menu.
338 #texinfo_no_detailmenu = False
339
340
341 # -- Options for block diagrams -------------------------------------------
342
343 # The paths to truetype fonts. blockdiag_fontpath option accepts both
344 # single path string and list of paths.
345 blockdiag_fontpath = []
346
347 # The path to fontmap definitions.
348 blockdiag_fontmap = ""
349
350 # Render diagrams in antialias mode or not.
351 blockdiag_antialias = True
352
353 # Render diagrams as transparency or not.
354 blockdiag_transparency = True
355
356 # The output image format at generating HTML docs ("PNG" or "SVG").
357 blockdiag_html_image_format = "SVG"
358
359 # The output image format at generating PDF docs (through LaTeX). ("PNG" or
360 # "PDF").  When a value of PDF is specified, you can get clear diagram
361 # images. In which case, reportlab library is required.
362 blockdiag_latex_image_format = "PNG"
363
364 # Enable debug mode of blockdiag.
365 blockdiag_debug = False