Fix for use of sphinx's manpage writer with docutils-0.10

This commit is contained in:
Toshio Kuratomi 2012-08-24 06:47:45 -07:00
parent 3b05e7e3e8
commit 949853df27
2 changed files with 36 additions and 1 deletions

View File

@ -9,7 +9,7 @@
Name: python-sphinx
Version: 1.1.3
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Python documentation generator
Group: Development/Tools
@ -21,6 +21,8 @@ Group: Development/Tools
License: BSD and Public Domain and Python and (MIT or GPLv2)
URL: http://sphinx.pocoo.org/
Source0: http://pypi.python.org/packages/source/S/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
# Sent upstream as a fix to work with the next version of docutils
Patch0: sphinx-docutils-0.10.patch
BuildArch: noarch
BuildRequires: python2-devel >= 2.4
@ -133,6 +135,8 @@ This package contains documentation in reST and HTML formats.
%setup -q -n %{upstream_name}-%{version}%{?prerel}
sed '1d' -i sphinx/pycode/pgen2/token.py
%patch0 -p1
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
@ -252,6 +256,9 @@ popd
%changelog
* Tue Aug 21 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1.3-5
- Fix for use of sphinx's manpage writer with docutils-0.10
* Mon Aug 6 2012 Michel Salim <salimma@fedoraproject.org> - 1.1.3-4
- Rebuild for Python 3.3

View File

@ -0,0 +1,28 @@
diff -up Sphinx-1.1.3/sphinx/writers/manpage.py.bak Sphinx-1.1.3/sphinx/writers/manpage.py
--- Sphinx-1.1.3/sphinx/writers/manpage.py.bak 2011-11-01 00:38:44.000000000 -0700
+++ Sphinx-1.1.3/sphinx/writers/manpage.py 2012-08-21 12:38:33.380808202 -0700
@@ -72,6 +72,11 @@ class ManualPageTranslator(BaseTranslato
# since self.append_header() is never called, need to do this here
self.body.append(MACRO_DEF)
+ # Overwrite admonition label translations with our own
+ for label, translation in admonitionlabels.items():
+ self.language.labels[label] = self.deunicode(translation)
+
+
# overwritten -- added quotes around all .TH arguments
def header(self):
tmpl = (".TH \"%(title_upper)s\" \"%(manual_section)s\""
@@ -193,12 +198,6 @@ class ManualPageTranslator(BaseTranslato
def depart_seealso(self, node):
self.depart_admonition(node)
- # overwritten -- use our own label translations
- def visit_admonition(self, node, name=None):
- if name:
- self.body.append('.IP %s\n' %
- self.deunicode(admonitionlabels.get(name, name)))
-
def visit_productionlist(self, node):
self.ensure_eol()
names = []