]> git.pld-linux.org Git - packages/sphinx-pdg.git/commitdiff
- fix interoperability with docutils 0.13 (https://github.com/sphinx-doc/sphinx/issue... auto/th/sphinx-pdg-1.4.1-3
authorJan Rękorajski <baggins@pld-linux.org>
Fri, 27 Jan 2017 10:07:34 +0000 (11:07 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Fri, 27 Jan 2017 10:07:34 +0000 (11:07 +0100)
- rel 3

docutils-0.13.patch [new file with mode: 0644]
sphinx-pdg.spec

diff --git a/docutils-0.13.patch b/docutils-0.13.patch
new file mode 100644 (file)
index 0000000..44c3589
--- /dev/null
@@ -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
index 56ba60ef566ee6095cfd58674216f249d04c55f6..55b34216c904da7e6cd6b554656ed81a9f948424 100644 (file)
@@ -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}
This page took 0.119898 seconds and 4 git commands to generate.