Skip to content

Commit

Permalink
Merge branch '1.0-branch' of github.com:Pylons/pyramid into 1.0-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonc committed Jan 6, 2013
2 parents e7abad0 + c6ae80a commit 0ee5c78
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 15 deletions.
40 changes: 26 additions & 14 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from docutils import nodes
from docutils import utils


def raw(*arg):
raise nodes.SkipNode
TextTranslator.visit_raw = raw
Expand All @@ -48,6 +49,7 @@ def nothing(*arg):
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'repoze.sphinx.autointerface',
'sphinx.ext.viewcode',
# 'sphinx.ext.intersphinx'
]

Expand Down Expand Up @@ -81,6 +83,7 @@ def nothing(*arg):
#
# The short X.Y version.
version = '1.0.2'

# The full version, including alpha/beta/rc tags.
release = version

Expand All @@ -95,7 +98,7 @@ def nothing(*arg):

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_themes/README.rst',]
exclude_patterns = ['_themes/README.rst', ]

# List of directories, relative to source directories, that shouldn't be searched
# for source files.
Expand Down Expand Up @@ -127,12 +130,12 @@ def nothing(*arg):
# -----------------------

# Add and use Pylons theme
if 'sphinx-build' in ' '.join(sys.argv): # protect against dumb importers
if 'sphinx-build' in ' '.join(sys.argv): # protect against dumb importers
from subprocess import call, Popen, PIPE

p = Popen('which git', shell=True, stdout=PIPE)
cwd = os.getcwd()
_themes = os.path.join(cwd, '_themes')
p = Popen('which git', shell=True, stdout=PIPE)
git = p.stdout.read().strip()
if not os.listdir(_themes):
call([git, 'submodule', '--init'])
Expand All @@ -155,9 +158,9 @@ def nothing(*arg):
html_theme_path = ['_themes']
html_theme = 'pyramid'
html_theme_options = dict(
github_url='https://github.com/Pylons/pyramid'
github_url='https://github.com/Pylons/pyramid',
# in_progress='true',
)

# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
Expand Down Expand Up @@ -231,6 +234,8 @@ def nothing(*arg):
# The font size ('10pt', '11pt' or '12pt').
latex_font_size = '10pt'

latex_additional_files = ['_static/latex-note.png', '_static/latex-warning.png']

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
latex_documents = [
Expand Down Expand Up @@ -367,10 +372,10 @@ def nothing(*arg):

latex_elements = {
'preamble': _PREAMBLE,
'wrapperclass':'book',
'date':'',
'releasename':'Version',
'title':r'The Pyramid Web Application \newline Development Framework',
'wrapperclass': 'book',
'date': '',
'releasename': 'Version',
'title': r'The Pyramid Web Application \newline Development Framework',
# 'pointsize':'12pt', # uncomment for 12pt version
}

Expand All @@ -386,6 +391,7 @@ def nothing(*arg):
#paragraph 4
#subparagraph 5


def frontmatter(name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
return [nodes.raw(
Expand All @@ -403,6 +409,7 @@ def frontmatter(name, arguments, options, content, lineno,
""",
format='latex')]


def mainmatter(name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
return [nodes.raw(
Expand All @@ -422,11 +429,13 @@ def mainmatter(name, arguments, options, content, lineno,
""",
format='latex')]


def backmatter(name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
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)."""
Expand All @@ -444,6 +453,7 @@ def setup(app):
app.add_directive('backmatter', backmatter, 1, (0, 0, 0))
app.connect('autodoc-process-signature', resig)


def resig(app, what, name, obj, options, signature, return_annotation):
""" Allow for preservation of ``@action_method`` decorated methods
in configurator """
Expand All @@ -470,10 +480,11 @@ def resig(app, what, name, obj, options, signature, return_annotation):
# -- Options for Epub output ---------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = 'The Pyramid Web Application Development Framework, Version 1.0.2'
epub_title = 'The Pyramid Web Application Development Framework, Version %s' \
% release
epub_author = 'Chris McDonough'
epub_publisher = 'Agendaless Consulting'
epub_copyright = '2008-2011'
epub_copyright = '2008-%d' % datetime.datetime.now().year

# The language of the text. It defaults to the language option
# or en if the language is not set.
Expand All @@ -487,8 +498,8 @@ def resig(app, what, name, obj, options, signature, return_annotation):
epub_identifier = '0615445675'

# A unique identification for the text.
epub_uid = 'The Pyramid Web Application Development Framework, Version 1.0.2'

epub_uid = 'The Pyramid Web Application Development Framework, Version %s' \
% release
# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []
Expand All @@ -500,7 +511,8 @@ def resig(app, what, name, obj, options, signature, return_annotation):
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js',
'_static/jquery.js', '_static/searchtools.js', '_static/underscore.js',
'_static/basic.css', 'search.html']
'_static/basic.css', 'search.html', '_static/websupport.js']


# The depth of the table of contents in toc.ncx.
epub_tocdepth = 3
2 changes: 1 addition & 1 deletion docs/make_book
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
make clean latex SPHINXBUILD=../bookenv/bin/sphinx-build BOOK=1
make clean latex SPHINXBUILD=../env/bin/sphinx-build BOOK=1
cd _build/latex && make all-pdf

2 changes: 2 additions & 0 deletions docs/make_epub
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
make clean epub SPHINXBUILD=../env/bin/sphinx-build
4 changes: 4 additions & 0 deletions docs/make_pdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
make clean latex SPHINXBUILD=../env/bin/sphinx-build
cd _build/latex && make all-pdf

1 change: 1 addition & 0 deletions docs/remake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
make clean html SPHINXBUILD=../env/bin/sphinx-build

0 comments on commit 0ee5c78

Please sign in to comment.