mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add :confval:texinfo_show_urls.
This commit is contained in:
@@ -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'``
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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 = '''
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user