From 5ffc46f686b56f407abde5732a0c52f33f8b3107 Mon Sep 17 00:00:00 2001 From: grubert Date: Mon, 21 Dec 2009 14:57:56 +0000 Subject: [PATCH] Titles level 1, that is ``.SH``, always uppercase. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6212 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- HISTORY.txt | 1 + docutils/writers/manpage.py | 3 ++- test/test_writers/test_manpage.py | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/HISTORY.txt b/HISTORY.txt index df5387872..2b73721c0 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -43,6 +43,7 @@ __ docs/user/config.html#docutils-footnotes * docutils/writers/manpage.py + - Titles level 1, that is ``.SH``, always uppercase. - Apply patch from mg: literal text should be bold in man-pages. * docutils/nodes.py diff --git a/docutils/writers/manpage.py b/docutils/writers/manpage.py index 3a9389592..eb9262154 100644 --- a/docutils/writers/manpage.py +++ b/docutils/writers/manpage.py @@ -1046,7 +1046,8 @@ class Translator(nodes.NodeVisitor): self._docinfo['title_upper'] = node.astext().upper() raise nodes.SkipNode elif self.section_level == 1: - self.body.append('.SH ') + self.body.append('.SH %s\n' % self.deunicode(node.astext().upper())) + raise nodes.SkipNode else: self.body.append('.SS ') diff --git a/test/test_writers/test_manpage.py b/test/test_writers/test_manpage.py index 40163b8f6..98d271bde 100644 --- a/test/test_writers/test_manpage.py +++ b/test/test_writers/test_manpage.py @@ -99,7 +99,7 @@ OPTIONS --version, -V Show this program's version number and exit. --help, -h Show this help message and exit. -Other Section +OTHER SECTION ============= With mixed case. @@ -135,7 +135,7 @@ Show this program\(aqs version number and exit. . Show this help message and exit. .UNINDENT -.SH Other Section +.SH OTHER SECTION .sp With mixed case. .SH AUTHOR -- 2.11.4.GIT