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