mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
merge with bb+http://jonathanj/sphinx
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -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)
|
||||
==============================
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -161,6 +161,7 @@ class Config(object):
|
||||
|
||||
# manpage options
|
||||
man_pages = ([], None),
|
||||
man_show_urls = (False, None),
|
||||
|
||||
# Texinfo options
|
||||
texinfo_documents = ([], None),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user