diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/Makefile | 11 | ||||
| -rw-r--r-- | docs/conf.py | 74 | ||||
| -rwxr-xr-x | docs/make_book | 2 | ||||
| -rwxr-xr-x | docs/make_pdf | 2 | ||||
| -rw-r--r-- | docs/narr/urldispatch.rst | 18 | ||||
| -rw-r--r-- | docs/quick_tutorial/authentication/setup.py | 1 | ||||
| -rw-r--r-- | docs/quick_tutorial/authorization/setup.py | 1 | ||||
| -rw-r--r-- | docs/quick_tutorial/json/setup.py | 1 | ||||
| -rw-r--r-- | docs/quick_tutorial/logging/setup.py | 1 | ||||
| -rw-r--r-- | docs/quick_tutorial/more_view_classes/setup.py | 1 | ||||
| -rw-r--r-- | docs/quick_tutorial/requirements.rst | 32 | ||||
| -rw-r--r-- | docs/quick_tutorial/retail_forms/setup.py | 1 | ||||
| -rw-r--r-- | docs/quick_tutorial/routing/setup.py | 1 | ||||
| -rw-r--r-- | docs/quick_tutorial/sessions/setup.py | 1 | ||||
| -rw-r--r-- | docs/quick_tutorial/static_assets/setup.py | 1 | ||||
| -rw-r--r-- | docs/quick_tutorial/templating/setup.py | 1 | ||||
| -rw-r--r-- | docs/quick_tutorial/tutorial_approach.rst | 16 | ||||
| -rw-r--r-- | docs/quick_tutorial/view_classes/setup.py | 1 | ||||
| -rw-r--r-- | docs/typographical-conventions.rst | 24 |
19 files changed, 73 insertions, 117 deletions
diff --git a/docs/Makefile b/docs/Makefile index 411ff35df..91f36aefc 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -12,7 +12,7 @@ PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -.PHONY: help clean html text web pickle htmlhelp latex latexpdf changes linkcheck epub doctest +.PHONY: help clean html text web pickle htmlhelp latex latexpdf xelatexpdf changes linkcheck epub doctest help: @echo "Please use \`make <target>' where <target> is one of" @@ -22,6 +22,7 @@ help: @echo " htmlhelp to make HTML files and a HTML help project" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " xelatexpdf to make LaTeX files and run them through xelatex" @echo " changes to make an overview over all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " epub to make an epub" @@ -30,6 +31,12 @@ help: clean: -rm -rf $(BUILDDIR)/* +xelatexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through xelatex..." + $(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex all-pdf + @echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex." + html: mkdir -p $(BUILDDIR)/html $(BUILDDIR)/doctrees $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @@ -68,7 +75,7 @@ latex: cp _static/latex-note.png $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make latexpdf' to build a PDF file from them." + @echo "Run \`make xelatexpdf' to build a PDF file from them." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex diff --git a/docs/conf.py b/docs/conf.py index cf92e05e8..80585b336 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -53,7 +53,6 @@ extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', - 'sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinxcontrib.autoprogram', # enable pylons_sphinx_latesturl when this branch is no longer "latest" @@ -124,9 +123,6 @@ exclude_patterns = ['_themes/README.rst', ] # unit titles (such as .. function::). add_module_names = False -# Add support for todo items -todo_include_todos = True - # The name of the Pygments (syntax highlighting) style to use. #pygments_style = book and 'bw' or 'tango' if book: @@ -190,7 +186,10 @@ latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). latex_font_size = '10pt' -latex_additional_files = ['_static/latex-note.png', '_static/latex-warning.png'] +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]). @@ -220,6 +219,17 @@ latex_domain_indices = False _PREAMBLE = r""" \usepackage[]{geometry} \geometry{bindingoffset=0.45in,textheight=7.25in,hdivide={0.5in,*,0.75in},vdivide={1in,7.25in,1in},papersize={7.5in,9.25in}} + +%XeLaTeX packages +\usepackage{xltxtra} +\usepackage{fontspec} %Font package +\usepackage{xunicode} + +%Select fonts +\setmainfont[Mapping=tex-text]{nimbusserif} +\setsansfont[Mapping=tex-text]{nimbussans} +\setmonofont{nimbusmono} + \hypersetup{ colorlinks=true, linkcolor=black, @@ -276,28 +286,22 @@ _PREAMBLE = r""" \definecolor{VerbatimColor}{rgb}{1,1,1} \definecolor{VerbatimBorderColor}{rgb}{1,1,1} -\makeatletter -\renewcommand{\py@noticestart@warning}{\py@heavybox} -\renewcommand{\py@noticeend@warning}{\py@endheavybox} -\renewcommand{\py@noticestart@note}{\py@heavybox} -\renewcommand{\py@noticeend@note}{\py@endheavybox} -\makeatother - % icons in note and warning boxes \usepackage{ifthen} -% Keep a copy of the original notice environment -\let\origbeginnotice\notice -\let\origendnotice\endnotice -% Redefine the notice environment so we can add our own code to it -\renewenvironment{notice}[2]{% - \origbeginnotice{#1}{}% equivalent to original \begin{notice}{#1}{#2} +% Keep a copy of the original sphinxadmonition environment +\let\origbeginadmon\sphinxadmonition +\let\origendadmon\endsphinxadmonition + +% Redefine the sphinxadmonition environment so we can add our own code to it +\renewenvironment{sphinxadmonition}[2]{% + \origbeginadmon{#1}{}% equivalent to original \begin{sphinxadmonition}{#1}{#2} % load graphics \ifthenelse{\equal{#1}{warning}}{\includegraphics{latex-warning.png}}{} \ifthenelse{\equal{#1}{note}}{\includegraphics{latex-note.png}}{} % etc. -}{% - \origendnotice% equivalent to original \end{notice} + }{% +\origendadmon % equivalent to original \end{sphinxadmonition} } % try to prevent code-block boxes from splitting across pages @@ -318,7 +322,6 @@ _PREAMBLE = r""" latex_elements = { 'preamble': _PREAMBLE, - 'wrapperclass': 'book', 'date': '', 'releasename': 'Version', 'title': r'The Pyramid Web Framework', @@ -342,17 +345,6 @@ def frontmatter(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): return [nodes.raw( '', - r""" -\frontmatter -% prevent part/chapter/section numbering -\setcounter{secnumdepth}{-2} -% suppress headers -\pagestyle{plain} -% reset page counter -\setcounter{page}{1} -% suppress first toc pagenum -\addtocontents{toc}{\protect\thispagestyle{empty}} -""", format='latex')] @@ -360,26 +352,14 @@ def mainmatter(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): return [nodes.raw( '', - r""" -\mainmatter -% allow part/chapter/section numbering -\setcounter{secnumdepth}{2} -% get headers back -\pagestyle{fancy} -\fancyhf{} -\renewcommand{\headrulewidth}{0.5pt} -\renewcommand{\footrulewidth}{0pt} -\fancyfoot[C]{\thepage} -\fancyhead[RO]{\rightmark} -\fancyhead[LE]{\leftmark} -""", 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')] + return [nodes.raw( + '', + format='latex')] def app_role(role, rawtext, text, lineno, inliner, options={}, content=[]): diff --git a/docs/make_book b/docs/make_book index 94e249441..c3d3743ae 100755 --- a/docs/make_book +++ b/docs/make_book @@ -1,4 +1,4 @@ #!/bin/sh -make clean latex SPHINXBUILD=../env/bin/sphinx-build BOOK=1 +make clean xelatexpdf SPHINXBUILD=../env/bin/sphinx-build BOOK=1 cd _build/latex && make all-pdf diff --git a/docs/make_pdf b/docs/make_pdf index 6c9863bc9..6cf0ff726 100755 --- a/docs/make_pdf +++ b/docs/make_pdf @@ -1,4 +1,4 @@ #!/bin/sh -make clean latex SPHINXBUILD=../env/bin/sphinx-build +make clean xelatexpdf SPHINXBUILD=../env/bin/sphinx-build cd _build/latex && make all-pdf diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index 9ac01e24a..00c7bd3bf 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -1045,6 +1045,24 @@ may be added in the future. For example: config = Configurator() config.include(users_include, route_prefix='/users') +A convenience context manager exists to set the route prefix for any +:meth:`pyramid.config.Configurator.add_route` or +:meth:`pyramid.config.Configurator.include` calls within the context. + +.. code-block:: python + :linenos: + + from pyramid.config import Configurator + + def timing_include(config): + config.add_route('timing.show_times', '/times') + + def main(global_config, **settings) + config = Configurator() + with config.route_prefix_context('/timing'): + config.include(timing_include) + config.add_route('timing.average', '/average') + .. index:: single: route predicates (custom) diff --git a/docs/quick_tutorial/authentication/setup.py b/docs/quick_tutorial/authentication/setup.py index e89b4e241..a5117af5a 100644 --- a/docs/quick_tutorial/authentication/setup.py +++ b/docs/quick_tutorial/authentication/setup.py @@ -5,7 +5,6 @@ requires = [ 'pyramid', 'pyramid_chameleon', 'waitress', - ] setup(name='tutorial', diff --git a/docs/quick_tutorial/authorization/setup.py b/docs/quick_tutorial/authorization/setup.py index e89b4e241..a5117af5a 100644 --- a/docs/quick_tutorial/authorization/setup.py +++ b/docs/quick_tutorial/authorization/setup.py @@ -5,7 +5,6 @@ requires = [ 'pyramid', 'pyramid_chameleon', 'waitress', - ] setup(name='tutorial', diff --git a/docs/quick_tutorial/json/setup.py b/docs/quick_tutorial/json/setup.py index 1699d9b1e..744612371 100644 --- a/docs/quick_tutorial/json/setup.py +++ b/docs/quick_tutorial/json/setup.py @@ -4,7 +4,6 @@ requires = [ 'pyramid', 'pyramid_chameleon', 'waitress', - ] setup(name='tutorial', diff --git a/docs/quick_tutorial/logging/setup.py b/docs/quick_tutorial/logging/setup.py index 1699d9b1e..744612371 100644 --- a/docs/quick_tutorial/logging/setup.py +++ b/docs/quick_tutorial/logging/setup.py @@ -4,7 +4,6 @@ requires = [ 'pyramid', 'pyramid_chameleon', 'waitress', - ] setup(name='tutorial', diff --git a/docs/quick_tutorial/more_view_classes/setup.py b/docs/quick_tutorial/more_view_classes/setup.py index 1699d9b1e..744612371 100644 --- a/docs/quick_tutorial/more_view_classes/setup.py +++ b/docs/quick_tutorial/more_view_classes/setup.py @@ -4,7 +4,6 @@ requires = [ 'pyramid', 'pyramid_chameleon', 'waitress', - ] setup(name='tutorial', diff --git a/docs/quick_tutorial/requirements.rst b/docs/quick_tutorial/requirements.rst index a65cfe6d2..29f263176 100644 --- a/docs/quick_tutorial/requirements.rst +++ b/docs/quick_tutorial/requirements.rst @@ -79,15 +79,15 @@ will reside as we proceed through the tutorial: .. code-block:: text - `── ~ - `── projects - `── quick_tutorial - │── env - `── step_one - │── intro - │ │── __init__.py - │ `── app.py - `── setup.py + ~ + └── projects + └── quick_tutorial + ├── env + └── step_one + ├── intro + │ ├── __init__.py + │ └── app.py + └── setup.py For Linux, the commands to do so are as follows: @@ -202,17 +202,3 @@ part is pretty easy. We'll also install a WSGI server, Waitress. Our Python virtual environment now has the Pyramid software available as well as the ``waitress`` package. -You can optionally install some of the extra Python packages used in this -tutorial. - -.. code-block:: bash - - # Mac and Linux - $ $VENV/bin/pip install webtest pytest pytest-cov deform sqlalchemy \ - pyramid_chameleon pyramid_debugtoolbar pyramid_jinja2 waitress \ - pyramid_tm zope.sqlalchemy - -.. code-block:: doscon - - # Windows - c:\> %VENV%\Scripts\pip install webtest pytest pytest-cov deform sqlalchemy pyramid_chameleon pyramid_debugtoolbar pyramid_jinja2 waitress pyramid_tm zope.sqlalchemy diff --git a/docs/quick_tutorial/retail_forms/setup.py b/docs/quick_tutorial/retail_forms/setup.py index f64049792..968889e74 100644 --- a/docs/quick_tutorial/retail_forms/setup.py +++ b/docs/quick_tutorial/retail_forms/setup.py @@ -5,7 +5,6 @@ requires = [ 'pyramid', 'pyramid_chameleon', 'waitress', - ] setup(name='tutorial', diff --git a/docs/quick_tutorial/routing/setup.py b/docs/quick_tutorial/routing/setup.py index 1699d9b1e..744612371 100644 --- a/docs/quick_tutorial/routing/setup.py +++ b/docs/quick_tutorial/routing/setup.py @@ -4,7 +4,6 @@ requires = [ 'pyramid', 'pyramid_chameleon', 'waitress', - ] setup(name='tutorial', diff --git a/docs/quick_tutorial/sessions/setup.py b/docs/quick_tutorial/sessions/setup.py index 1699d9b1e..744612371 100644 --- a/docs/quick_tutorial/sessions/setup.py +++ b/docs/quick_tutorial/sessions/setup.py @@ -4,7 +4,6 @@ requires = [ 'pyramid', 'pyramid_chameleon', 'waitress', - ] setup(name='tutorial', diff --git a/docs/quick_tutorial/static_assets/setup.py b/docs/quick_tutorial/static_assets/setup.py index 1699d9b1e..744612371 100644 --- a/docs/quick_tutorial/static_assets/setup.py +++ b/docs/quick_tutorial/static_assets/setup.py @@ -4,7 +4,6 @@ requires = [ 'pyramid', 'pyramid_chameleon', 'waitress', - ] setup(name='tutorial', diff --git a/docs/quick_tutorial/templating/setup.py b/docs/quick_tutorial/templating/setup.py index 1699d9b1e..744612371 100644 --- a/docs/quick_tutorial/templating/setup.py +++ b/docs/quick_tutorial/templating/setup.py @@ -4,7 +4,6 @@ requires = [ 'pyramid', 'pyramid_chameleon', 'waitress', - ] setup(name='tutorial', diff --git a/docs/quick_tutorial/tutorial_approach.rst b/docs/quick_tutorial/tutorial_approach.rst index 7d87b6a49..83b229746 100644 --- a/docs/quick_tutorial/tutorial_approach.rst +++ b/docs/quick_tutorial/tutorial_approach.rst @@ -23,14 +23,14 @@ below: .. code-block:: text quick_tutorial - │── env - `── request_response - `── tutorial - │ │── __init__.py - │ │── tests.py - │ `── views.py - │── development.ini - `── setup.py + ├── env + └── request_response + ├── tutorial + │ ├── __init__.py + │ ├── tests.py + │ └── views.py + ├── development.ini + └── setup.py Each of the directories in our ``quick_tutorial`` workspace (e.g., ``request_response``) is a *Python project* (except as noted for the ``hello_world`` step). The ``tutorial`` diff --git a/docs/quick_tutorial/view_classes/setup.py b/docs/quick_tutorial/view_classes/setup.py index 1699d9b1e..744612371 100644 --- a/docs/quick_tutorial/view_classes/setup.py +++ b/docs/quick_tutorial/view_classes/setup.py @@ -4,7 +4,6 @@ requires = [ 'pyramid', 'pyramid_chameleon', 'waitress', - ] setup(name='tutorial', diff --git a/docs/typographical-conventions.rst b/docs/typographical-conventions.rst index f128effea..2bfe4ffa6 100644 --- a/docs/typographical-conventions.rst +++ b/docs/typographical-conventions.rst @@ -217,18 +217,6 @@ The version in which a feature is deprecated in a project is displayed as follow Use the ``require_csrf`` option or read :ref:`auto_csrf_checking` instead to have :class:`pyramid.exceptions.BadCSRFToken` exceptions raised. -.. _typographical-conventions-danger: - -Danger ------- - -Danger represents critical information related to a topic or concept, and should recommend to the user "don't do this dangerous thing". - -.. danger:: - - This is danger or an error. - - .. _typographical-conventions-warnings: Warnings @@ -265,18 +253,6 @@ See also See :ref:`Quick Tutorial section on Requirements <qtut_requirements>`. -.. _typographical-conventions-todo: - -Todo ----- - -Todo items designated tasks that require further work. - -.. todo:: - - This is a todo item. - - .. _typographical-conventions-cross-references: Cross-references |
