From 7250de67bdebc05e9b2c4e9db0491b06bb214f34 Mon Sep 17 00:00:00 2001 From: Theron Luhn Date: Sat, 30 Mar 2019 11:39:06 -0700 Subject: Fix docs build on Sphinx 2.0.0 Sphinx 2.0.0 was released, which triggered some warnings when building the docs and caused the build to fail. --- docs/conf.py | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'docs') diff --git a/docs/conf.py b/docs/conf.py index a6d37a176..8fdebf53d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -28,6 +28,7 @@ from sphinx.writers.latex import LaTeXTranslator from docutils import nodes from docutils import utils +from docutils.parsers.rst import Directive def raw(*arg): @@ -326,7 +327,6 @@ _PREAMBLE = r""" latex_elements = { 'preamble': _PREAMBLE, - 'date': '', 'releasename': 'Version', 'title': r'The Pyramid Web Framework', # 'pointsize':'12pt', # uncomment for 12pt version @@ -345,25 +345,25 @@ latex_elements = { #subparagraph 5 -def frontmatter(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - return [nodes.raw( - '', - format='latex')] +class FrontMatter(Directive): + def run(self): + return [nodes.raw( + '', + format='latex')] -def mainmatter(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - return [nodes.raw( - '', - format='latex')] +class MainMatter(Directive): + def run(self): + return [nodes.raw( + '', + format='latex')] -def backmatter(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - return [nodes.raw( - '', - format='latex')] +class BackMatter(Directive): + def run(self): + return [nodes.raw( + '', + format='latex')] def app_role(role, rawtext, text, lineno, inliner, options={}, content=[]): @@ -378,9 +378,9 @@ def app_role(role, rawtext, text, lineno, inliner, options={}, content=[]): 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)) + 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)) app.connect('autodoc-process-signature', resig) -- cgit v1.2.3