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