This commit is contained in:
Georg Brandl
2011-01-04 22:11:57 +01:00
5 changed files with 25 additions and 0 deletions

View File

@@ -54,6 +54,8 @@ Release 1.1 (in development)
* #209: Added :confval:`text_newlines` and :confval:`text_sectionchars`
config values.
* Added :confval:`man_show_urls` config value.
Release 1.0.6 (in development)
==============================

View File

@@ -1110,6 +1110,12 @@ These options influence manual page output.
.. versionadded:: 1.0
.. confval:: man_show_urls
If true, add URL addresses after links. Default is ``False``.
.. versionadded:: 1.1
.. _texinfo-options:

View File

@@ -161,6 +161,7 @@ class Config(object):
# manpage options
man_pages = ([], None),
man_show_urls = (False, None),
# Texinfo options
texinfo_documents = ([], None),

View File

@@ -255,6 +255,9 @@ man_pages = [
[u'%(author_str)s'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output ------------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples

View File

@@ -235,6 +235,19 @@ class ManualPageTranslator(BaseTranslator):
self.body.append(self.defs['reference'][0])
self.body.append(node.astext())
self.body.append(self.defs['reference'][1])
uri = node.get('refuri', '')
if uri.startswith('mailto:') or uri.startswith('http:') or \
uri.startswith('https:') or uri.startswith('ftp:'):
# if configured, put the URL after the link
if self.builder.config.man_show_urls and \
node.astext() != uri:
if uri.startswith('mailto:'):
uri = uri[7:]
self.body.extend([
' <',
self.defs['strong'][0], uri, self.defs['strong'][1],
'>'])
raise nodes.SkipNode
def visit_centered(self, node):