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