540662e056fc6d0ac6401dfcd00bbab04b8872a1
[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 substitutions.
114 rst_epilog = """
115 .. |DM4| replace:: *Inform Designer's Manual*
116 """
117
118 # External links.
119 extlinks = {
120     'dm4': ("http://inform-fiction.org/manual/html/%s", ""),
121 }
122
123 # The name of the Pygments (syntax highlighting) style to use.
124 pygments_style = 'friendly'
125
126 # The default Pygments highlight language.
127 highlight_language = 'none'
128
129 # A list of ignored prefixes for module index sorting.
130 #modindex_common_prefix = []
131
132 # If true, keep warnings as "system message" paragraphs in the built documents.
133 #keep_warnings = False
134
135 # If true, `todo` and `todoList` produce output, else they produce nothing.
136 todo_include_todos = True
137
138
139 # -- Options for HTML output ----------------------------------------------
140
141 # The theme to use for HTML and HTML Help pages.  See the documentation for
142 # a list of builtin themes.
143 html_theme = 'alabaster'
144
145 # Theme options are theme-specific and customize the look and feel of a theme
146 # further.  For a list of options available for each theme, see the
147 # documentation.
148 html_theme_options = {
149     'font_family': 'Georgia',
150     'head_font_family': 'Georgia',
151     'page_width': '1050px',
152     'show_related': True,
153 }
154
155 # Add any paths that contain custom themes here, relative to this directory.
156 #html_theme_path = []
157
158 # The name for this set of Sphinx documents.  If None, it defaults to
159 # "<project> v<release> documentation".
160 html_title = project
161
162 # A shorter title for the navigation bar.  Default is the same as html_title.
163 #html_short_title = None
164
165 # The name of an image file (relative to this directory) to place at the top
166 # of the sidebar.
167 #html_logo = None
168
169 # The name of an image file (within the static path) to use as favicon of the
170 # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
171 # pixels large.
172 #html_favicon = None
173
174 # Add any paths that contain custom static files (such as style sheets) here,
175 # relative to this directory. They are copied after the builtin static files,
176 # so a file named "default.css" will overwrite the builtin "default.css".
177 #html_static_path = ['static']
178
179 # Add any extra paths that contain custom files (such as robots.txt or
180 # .htaccess) here, relative to this directory. These files are copied
181 # directly to the root of the documentation.
182 #html_extra_path = []
183
184 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
185 # using the given strftime format.
186 #html_last_updated_fmt = '%b %d, %Y'
187
188 # If true, SmartyPants will be used to convert quotes and dashes to
189 # typographically correct entities.
190 #html_use_smartypants = True
191
192 # Custom sidebar templates, maps document names to template names.
193 #html_sidebars = {}
194
195 # Additional templates that should be rendered to pages, maps page names to
196 # template names.
197 #html_additional_pages = {}
198
199 # If false, no module index is generated.
200 #html_domain_indices = True
201
202 # If false, no index is generated.
203 #html_use_index = True
204
205 # If true, the index is split into individual pages for each letter.
206 #html_split_index = False
207
208 # If true, links to the reST sources are added to the pages.
209 #html_show_sourcelink = True
210
211 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
212 #html_show_sphinx = True
213
214 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
215 #html_show_copyright = True
216
217 # If true, an OpenSearch description file will be output, and all pages will
218 # contain a <link> tag referring to it.  The value of this option must be the
219 # base URL from which the finished HTML is served.
220 #html_use_opensearch = ''
221
222 # This is the file name suffix for HTML files (e.g. ".xhtml").
223 #html_file_suffix = None
224
225 # Language to be used for generating the HTML full-text search index.
226 # Sphinx supports the following languages:
227 #   'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
228 #   'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
229 #html_search_language = 'en'
230
231 # A dictionary with options for the search language support, empty by default.
232 # Now only 'ja' uses this config value
233 #html_search_options = {'type': 'default'}
234
235 # The name of a javascript file (relative to the configuration directory) that
236 # implements a search results scorer. If empty, the default will be used.
237 #html_search_scorer = 'scorer.js'
238
239 # Output file base name for HTML help builder.
240 htmlhelp_basename = 'IBG'
241
242 # -- Options for LaTeX output ---------------------------------------------
243
244 # Title page information.
245 latex_image = "harry_col"
246 latex_image_title = "First Steps"
247 latex_image_info = "(watercolour and crayon on paper, 2002) Harry Firth (2000-)"
248 latex_image_path = os.path.join('images', latex_image + '.png')
249 latex_additional_files = [latex_image_path]
250
251 template = string.Template(open('config/preamble.tex').read())
252
253 latex_contents = r"""
254 \coverpage
255 \licensepage
256 \historypage
257 \contentspage
258 \newpage
259 \maintext
260 """
261
262 latex_elements = {
263     # The paper size ('letterpaper' or 'a4paper').
264     'papersize': 'a4paper',
265
266     # The font size ('10pt', '11pt' or '12pt').
267     'pointsize': '12pt',
268
269     # Additional stuff for the LaTeX preamble.
270     'preamble': template.substitute(title=project,
271                                     author=author,
272                                     image=latex_image,
273                                     imagetitle=latex_image_title,
274                                     imageinfo=latex_image_info,
275                                     editor=editor,
276                                     edition=edition,
277                                     extra=extra,
278                                     licensetext=licensetext),
279
280     'tableofcontents': latex_contents,
281
282     'fontpkg': '',
283
284     # Latex figure (float) alignment
285     #'figure_align': 'htbp',
286 }
287  
288 # Grouping the document tree into LaTeX files. List of tuples
289 # (source start file, target name, title,
290 #  author, documentclass [howto, manual, or own class]).
291 latex_documents = [
292     (master_doc, 'IBG.tex', project, author, 'howto'),
293 ]
294
295 # The name of an image file (relative to this directory) to place at the top of
296 # the title page.
297 #latex_logo = None
298
299 # For "manual" documents, if this is true, then toplevel headings are parts,
300 # not chapters.
301 #latex_use_parts = False
302
303 # If true, show page references after internal links.
304 latex_show_pagerefs = True
305
306 # If true, show URL addresses after external links.
307 #latex_show_urls = False
308
309 # Documents to append as an appendix to all manuals.
310 #latex_appendices = []
311
312 # If false, no module index is generated.
313 #latex_domain_indices = True
314
315
316 # -- Options for manual page output ---------------------------------------
317
318 # One entry per manual page. List of tuples
319 # (source start file, name, description, authors, manual section).
320 man_pages = [
321     (master_doc, 'IBG', project, [author], 1)
322 ]
323
324 # If true, show URL addresses after external links.
325 #man_show_urls = False
326
327
328 # -- Options for Texinfo output -------------------------------------------
329
330 # Grouping the document tree into Texinfo files. List of tuples
331 # (source start file, target name, title, author,
332 #  dir menu entry, description, category)
333 texinfo_documents = [
334   (master_doc, 'ibg', project,
335    author, project, 'Beginner\'s guide to Inform.',
336    'Games'),
337 ]
338
339 # Documents to append as an appendix to all manuals.
340 #texinfo_appendices = []
341
342 # If false, no module index is generated.
343 #texinfo_domain_indices = True
344
345 # How to display URL addresses: 'footnote', 'no', or 'inline'.
346 #texinfo_show_urls = 'footnote'
347
348 # If true, do not generate a @detailmenu in the "Top" node's menu.
349 #texinfo_no_detailmenu = False
350
351
352 # -- Options for block diagrams -------------------------------------------
353
354 # The paths to truetype fonts. blockdiag_fontpath option accepts both
355 # single path string and list of paths.
356 blockdiag_fontpath = []
357
358 # The path to fontmap definitions.
359 blockdiag_fontmap = ""
360
361 # Render diagrams in antialias mode or not.
362 blockdiag_antialias = True
363
364 # Render diagrams as transparency or not.
365 blockdiag_transparency = True
366
367 # The output image format at generating HTML docs ("PNG" or "SVG").
368 blockdiag_html_image_format = "SVG"
369
370 # The output image format at generating PDF docs (through LaTeX). ("PNG" or
371 # "PDF").  When a value of PDF is specified, you can get clear diagram
372 # images. In which case, reportlab library is required.
373 blockdiag_latex_image_format = "PNG"
374
375 # Enable debug mode of blockdiag.
376 blockdiag_debug = False