# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys
import os
-import shlex
+import sys
+import string
+import codecs
+
+import alabaster
+if alabaster.version.__version_info__ < (0, 7, 8):
+ raise RuntimeError("requires albaster 0.7.8 or newer")
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
+sys.path.insert(0, ".")
+
+import tools.sphinxpatch
+
+from tools.inform import InformLexer
+from tools.transcript import TranscriptLexer
+
+# Setup function.
+def setup(app):
+ app.add_lexer('inform', InformLexer())
+ app.add_lexer('transcript', TranscriptLexer())
# -- General configuration ------------------------------------------------
# ones.
extensions = [
'sphinx.ext.todo',
+ 'sphinx.ext.extlinks',
+ 'tools.blockdiag',
]
# Add any paths that contain templates here, relative to this directory.
# The master toctree document.
master_doc = 'index'
-# General information about the project.
-project = u'Inform Beginner\'s Guide'
-author = u'Roger Firth and Sonja Kesserich'
-copyright = u'2016, ' + author
+# General document information.
+project = u"The Inform Beginner's Guide"
+author = u"Roger Firth and Sonja Kesserich"
+copyright = u'2004, ' + author
+
+editor = "Dennis G. Jerz"
+edition = "Third Edition: August 2004"
+extra = "With a foreword by Graham Nelson"
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
+licensetext = codecs.open('LICENSE', encoding='utf-8').read()
+
+# The version info for the project you're documenting, acts as replacement
+# for |version| and |release|, also used in various other places throughout
+# the built documents.
#
# The short X.Y version.
-version = '4.0'
+version = '3'
# The full version, including alpha/beta/rc tags.
-release = '4.0'
+release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
-exclude_patterns = ['output']
+exclude_patterns = ['config', 'output', 'tables']
# The reST default role (used for this markup: `text`) to use for all
# documents.
# output. They are ignored by default.
#show_authors = False
+# Global definitions.
+rst_prolog = open("config/defs.rst").read()
+
+# External links.
+extlinks = {
+ 'dm4': ("http://inform-fiction.org/manual/html/%s", ""),
+}
+
# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
+pygments_style = 'friendly'
# The default Pygments highlight language.
highlight_language = 'none'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
+# Turn off default domain.
+primary_domain = None
+
# -- Options for HTML output ----------------------------------------------
# a list of builtin themes.
html_theme = 'alabaster'
+# Override a few things with local CSS style.
+html_style = "ibg.css"
+
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
'font_family': 'Georgia',
'head_font_family': 'Georgia',
+ 'page_width': '1050px',
+ 'show_related': True,
+ 'fixed_sidebar': True,
}
# Add any paths that contain custom themes here, relative to this directory.
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
-#html_logo = None
+html_logo = 'logo.png'
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# -- Options for LaTeX output ---------------------------------------------
+# Title page information.
+latex_image = "harry_col"
+latex_image_title = "First Steps"
+latex_image_info = "(watercolour and crayon on paper, 2002) Harry Firth (2000-)"
+latex_image_path = os.path.join('images', latex_image + '.png')
+latex_additional_files = [latex_image_path]
+
+template = string.Template(open('config/preamble.tex').read())
+
+latex_contents = r"""
+\coverpage
+\licensepage
+\historypage
+\contentspage
+\newpage
+\maintext
+"""
+
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
'papersize': 'a4paper',
# The font size ('10pt', '11pt' or '12pt').
- 'pointsize': '10pt',
+ 'pointsize': '12pt',
# Additional stuff for the LaTeX preamble.
- #'preamble': '',
+ 'preamble': template.substitute(title=project,
+ author=author,
+ image=latex_image,
+ imagetitle=latex_image_title,
+ imageinfo=latex_image_info,
+ editor=editor,
+ edition=edition,
+ extra=extra,
+ licensetext=licensetext),
+
+ 'tableofcontents': latex_contents,
+
+ 'fontpkg': '',
# Latex figure (float) alignment
#'figure_align': 'htbp',
}
-
+
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- (master_doc, 'IBG.tex', project, author, 'manual'),
+ (master_doc, 'IBG.tex', project, author, 'howto'),
]
# The name of an image file (relative to this directory) to place at the top of
#latex_use_parts = False
# If true, show page references after internal links.
-#latex_show_pagerefs = False
+latex_show_pagerefs = True
# If true, show URL addresses after external links.
#latex_show_urls = False
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- (master_doc, 'informbeginnersguide', u'Inform Beginner\'s Guide',
- [author], 1)
+ (master_doc, 'IBG', project, [author], 1)
]
# If true, show URL addresses after external links.
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- (master_doc, 'ibg', u'Inform Beginner\'s Guide',
- author, 'Inform Beginners Guide', 'Beginner\'s guide to Inform.',
+ (master_doc, 'ibg', project,
+ author, project, 'Beginner\'s guide to Inform.',
'Games'),
]
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
+
+
+# -- Options for block diagrams -------------------------------------------
+
+# The paths to truetype fonts. blockdiag_fontpath option accepts both
+# single path string and list of paths.
+blockdiag_fontpath = []
+
+# The path to fontmap definitions.
+blockdiag_fontmap = ""
+
+# Render diagrams in antialias mode or not.
+blockdiag_antialias = True
+
+# Render diagrams as transparency or not.
+blockdiag_transparency = True
+
+# The output image format at generating HTML docs ("PNG" or "SVG").
+blockdiag_html_image_format = "SVG"
+
+# The output image format at generating PDF docs (through LaTeX). ("PNG" or
+# "PDF"). When a value of PDF is specified, you can get clear diagram
+# images. In which case, reportlab library is required.
+blockdiag_latex_image_format = "PNG"
+
+# Enable debug mode of blockdiag.
+blockdiag_debug = False