[packages/sphinx-pdg] - fix interoperability with docutils 0.13 (https://github.com/sphinx-doc/sphinx/issues/3212) - rel 3

baggins baggins at pld-linux.org
Fri Jan 27 11:08:29 CET 2017


commit 45b57c9732b5ae8a37ff158813727d826873779c
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Fri Jan 27 11:07:34 2017 +0100

    - fix interoperability with docutils 0.13 (https://github.com/sphinx-doc/sphinx/issues/3212)
    - rel 3

 docutils-0.13.patch | 29 +++++++++++++++++++++++++++++
 sphinx-pdg.spec     |  4 +++-
 2 files changed, 32 insertions(+), 1 deletion(-)
---
diff --git a/sphinx-pdg.spec b/sphinx-pdg.spec
index 56ba60e..55b3421 100644
--- a/sphinx-pdg.spec
+++ b/sphinx-pdg.spec
@@ -11,13 +11,14 @@ Summary:	Sphinx - Python documentation generator
 Summary(pl.UTF-8):	Sphinx - narzędzie do tworzenia dokumentacji dla Pythona
 Name:		sphinx-pdg
 Version:	1.4.1
-Release:	2
+Release:	3
 License:	BSD
 Group:		Development/Languages/Python
 #Source0Download: https://pypi.python.org/simple/Sphinx
 Source0:	https://pypi.python.org/packages/61/14/1b1edb28bebde124c455e4dea9cd70685ad8dd2f6baa1a8effe665ebeb23/Sphinx-%{version}.tar.gz
 # Source0-md5:	4c4988e0306a04cef8dccc384281e585
 Patch0:		float-ver.patch
+Patch1:		docutils-0.13.patch
 URL:		http://sphinx.pocoo.org/
 %if %{with python2}
 BuildRequires:	python-babel >= 1.3
@@ -144,6 +145,7 @@ sphinx-pdg-3.
 %prep
 %setup -q -n Sphinx-%{version}
 %patch0 -p1
+%patch1 -p1
 
 %build
 %if %{with python2}
diff --git a/docutils-0.13.patch b/docutils-0.13.patch
new file mode 100644
index 0000000..44c3589
--- /dev/null
+++ b/docutils-0.13.patch
@@ -0,0 +1,29 @@
+diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py
+index af8b6d9..07d16f8 100644
+--- a/sphinx/writers/html.py
++++ b/sphinx/writers/html.py
+@@ -16,6 +16,7 @@
+ import warnings
+ 
+ from six import string_types
++import docutils
+ from docutils import nodes
+ from docutils.writers.html4css1 import Writer, HTMLTranslator as BaseTranslator
+ 
+@@ -532,6 +533,16 @@ def visit_image(self, node):
+                         node['height'] = str(size[1])
+         BaseTranslator.visit_image(self, node)
+ 
++    # overwritten
++    def depart_image(self, node):
++        if tuple(map(int, docutils.__version__.split('.'))) >= (0, 13):
++            # since docutils-0.13, HTMLWriter does not push context data on visit_image()
++            if node['uri'].lower().endswith(('svg', 'svgz')):
++                self.body.append(self.context.pop())
++        else:
++            # docutils-0.12 or below, HTML Writer always push context data on visit_image()
++            self.body.append(self.context.pop())
++
+     def visit_toctree(self, node):
+         # this only happens when formatting a toc from env.tocs -- in this
+         # case we don't want to include the subtree
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/sphinx-pdg.git/commitdiff/45b57c9732b5ae8a37ff158813727d826873779c



More information about the pld-cvs-commit mailing list