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