Resolve TODO from chapter 11.
[ibg.git] / conf.py
diff --git a/conf.py b/conf.py
index 00111b4a55a0d6ebeff1d12d0a22d530bd7a3422..d7cd39c416efe6328b594eaff2b9ab8fc36d71a2 100644 (file)
--- a/conf.py
+++ b/conf.py
@@ -17,15 +17,23 @@ 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('tools'))
+sys.path.insert(0, ".")
+
+import tools.sphinxpatch
 
-from transcript import TranscriptLexer
+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 ------------------------------------------------
@@ -38,6 +46,8 @@ def setup(app):
 # ones.
 extensions = [
     'sphinx.ext.todo',
+    'sphinx.ext.extlinks',
+    'tools.blockdiag',
 ]
 
 # Add any paths that contain templates here, relative to this directory.
@@ -87,7 +97,7 @@ language = None
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
-exclude_patterns = ['config', 'output']
+exclude_patterns = ['config', 'output', 'tables']
 
 # The reST default role (used for this markup: `text`) to use for all
 # documents.
@@ -104,8 +114,16 @@ default_role = "any"
 # 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 = 'default'
+pygments_style = 'friendly'
 
 # The default Pygments highlight language.
 highlight_language = 'none'
@@ -119,6 +137,9 @@ 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 ----------------------------------------------
 
@@ -126,6 +147,9 @@ todo_include_todos = True
 # 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.
@@ -134,6 +158,7 @@ html_theme_options = {
     '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.
@@ -226,7 +251,7 @@ htmlhelp_basename = 'IBG'
 # -- Options for LaTeX output ---------------------------------------------
 
 # Title page information.
-latex_image = "harry1"
+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')
@@ -285,7 +310,7 @@ latex_documents = [
 #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
@@ -331,3 +356,30 @@ texinfo_documents = [
 
 # 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