summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Waltman <jonathan.waltman@gmail.com>2011-03-06 00:30:19 -0600
committerJonathan Waltman <jonathan.waltman@gmail.com>2011-03-06 00:30:19 -0600
commit54290ed0e668e56c6b104a8a5f98224e33a59b2c (patch)
tree31f39810b28a37e47532921a318fdf179a1fa2ae
parent20dcad36a3fd50aa541581c87f54b9e786018570 (diff)
downloadsphinx-git-54290ed0e668e56c6b104a8a5f98224e33a59b2c.tar.gz
Add :confval:`texinfo_show_urls`.
-rw-r--r--doc/config.rst30
-rw-r--r--sphinx/config.py1
-rw-r--r--sphinx/quickstart.py3
-rw-r--r--sphinx/writers/texinfo.py4
4 files changed, 32 insertions, 6 deletions
diff --git a/doc/config.rst b/doc/config.rst
index aa0eeed97..b82b107dd 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -1164,9 +1164,10 @@ These options influence Texinfo output.
* *targetname*: file name (no extension) of the Texinfo file in the output
directory.
* *title*: Texinfo document title. Can be empty to use the title of the
- *startdoc*.
- * *author*: Author for the Texinfo document. Use ``\and`` to separate
- multiple authors, as in: ``'John \and Sarah'``.
+ *startdoc*. Inserted as Texinfo markup, so special characters like @ and
+ {} will need to be escaped to be inserted literally.
+ * *author*: Author for the Texinfo document. Inserted as Texinfo markup.
+ Use ``@*`` to separate multiple authors, as in: ``'John@*Sarah'``.
* *dir_entry*: The name that will appear in the top-level ``DIR`` menu file.
* *description*: Descriptive text to appear in the top-level ``DIR`` menu
file.
@@ -1197,6 +1198,16 @@ These options influence Texinfo output.
.. versionadded:: 1.1
+.. confval:: texinfo_show_urls
+
+ Control how to display URL addresses.
+
+ * ``'footnote'`` -- display URLs in footnotes (default)
+ * ``'no'`` -- do not display URLs
+ * ``'inline'`` -- display URLs inline in parentheses
+
+ .. versionadded:: 1.1
+
.. confval:: texinfo_elements
A dictionary that contains Texinfo snippets that override those Sphinx
@@ -1213,12 +1224,23 @@ These options influence Texinfo output.
default ``4``. Specify ``0`` for no indentation.
``'preamble'``
- Text inserted as is near the beginning of the file.
+ Texinfo markup inserted near the beginning of the file.
+
+ ``'copying'``
+ Texinfo markup inserted within the ``@copying`` block and displayed
+ after the title. The default value consists of a simple title page
+ identifying the project.
* Keys that are set by other options and therefore should not be overridden
are:
+ ``'author'``
+ ``'body'``
+ ``'date'``
+ ``'direntry'``
``'filename'``
+ ``'project'``
+ ``'release'``
``'title'``
``'direntry'``
diff --git a/sphinx/config.py b/sphinx/config.py
index f4c0946b5..143dcd711 100644
--- a/sphinx/config.py
+++ b/sphinx/config.py
@@ -169,6 +169,7 @@ class Config(object):
texinfo_appendices = ([], None),
texinfo_elements = ({}, None),
texinfo_domain_indices = (True, None),
+ texinfo_show_urls = ('footnote', None),
# linkcheck options
linkcheck_ignore = ([], None),
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index 583be99fd..5b6e3e491 100644
--- a/sphinx/quickstart.py
+++ b/sphinx/quickstart.py
@@ -274,6 +274,9 @@ texinfo_documents = [
# If false, no module index is generated.
#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
'''
EPUB_CONFIG = '''
diff --git a/sphinx/writers/texinfo.py b/sphinx/writers/texinfo.py
index e4e1d7bb8..7eb63c842 100644
--- a/sphinx/writers/texinfo.py
+++ b/sphinx/writers/texinfo.py
@@ -486,7 +486,7 @@ class TexinfoTranslator(nodes.NodeVisitor):
sid = self.get_short_id(id)
for id in (eid, sid):
if id not in self.written_ids:
- self.body.append('@anchor{%s}\n' % id)
+ self.body.append('@anchor{%s}' % id)
self.written_ids.add(id)
def add_xref(self, id, name, node):
@@ -670,7 +670,7 @@ class TexinfoTranslator(nodes.NodeVisitor):
else:
uri = self.escape_arg(uri)
name = self.escape_arg(name)
- show_urls = 'footnote'
+ show_urls = self.builder.config.texinfo_show_urls
if self.in_footnote:
show_urls = 'inline'
if not name or uri == name: