summaryrefslogtreecommitdiff
path: root/docs/conf.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-11-09 03:54:45 -0500
committerChris McDonough <chrism@plope.com>2010-11-09 03:54:45 -0500
commitfd5ae92bd218b72a7a923e406eee023afe024dc0 (patch)
tree17fd402d2d06a0360f813e682e73bb780874a2a4 /docs/conf.py
parentf383367b91b02b28e2beec8132241003aacbedfd (diff)
downloadpyramid-fd5ae92bd218b72a7a923e406eee023afe024dc0.tar.gz
pyramid-fd5ae92bd218b72a7a923e406eee023afe024dc0.tar.bz2
pyramid-fd5ae92bd218b72a7a923e406eee023afe024dc0.zip
- All references to Pyramid-the-application were changed from :mod:`pyramid`
to :app:`Pyramid`. A custom role setting was added to ``docs/conf.py`` to allow for this. (internal)
Diffstat (limited to 'docs/conf.py')
-rw-r--r--docs/conf.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 569855aa5..88cf07797 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -17,6 +17,8 @@ import datetime
# skip raw nodes
from sphinx.writers.text import TextTranslator
from docutils import nodes
+from docutils import utils
+
def raw(*arg):
raise nodes.SkipNode
TextTranslator.visit_raw = raw
@@ -320,8 +322,6 @@ latex_elements = {
# 'pointsize':'12pt', # uncomment for 12pt version
}
-from docutils import nodes
-
# secnumdepth counter reset to 2 causes numbering in related matter;
# reset to -1 causes chapters to not be numbered, reset to -2 causes
# parts to not be numbered.
@@ -375,7 +375,18 @@ def backmatter(name, arguments, options, content, lineno,
return [nodes.raw('', '\\backmatter\n\\setcounter{secnumdepth}{-1}\n',
format='latex')]
+def app_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
+ """custom role for :app: marker, does nothing in particular except allow
+ :app:`Pyramid` to work (for later search and replace)."""
+ if 'class' in options:
+ assert 'classes' not in options
+ options['classes'] = options['class']
+ del options['class']
+ return [nodes.inline(rawtext, utils.unescape(text), **options)], []
+
+
def setup(app):
+ app.add_role('app', app_role)
app.add_directive('frontmatter', frontmatter, 1, (0, 0, 0))
app.add_directive('mainmatter', mainmatter, 1, (0, 0, 0))
app.add_directive('backmatter', backmatter, 1, (0, 0, 0))