mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1110: Add new config value texinfo_no_detailmenu and do not generate detailed menus for non-"Top" nodes.
This commit is contained in:
parent
4e87ea0517
commit
e3a27b76f2
6
CHANGES
6
CHANGES
@ -1,6 +1,12 @@
|
||||
Release 1.2 (in development)
|
||||
============================
|
||||
|
||||
* #1110: Added a new configuration value :confval:`texinfo_no_detailmenu` for
|
||||
controlling whether the Texinfo writer generates a ``@detailmenu`` in the
|
||||
"Top" node's menu.
|
||||
|
||||
* The Texinfo writer now only generates detailed menus for the "Top" node.
|
||||
|
||||
* New locales: #1097: Added Basque locale.
|
||||
|
||||
* Fix text builder did not respect wide/fullwidth characters:
|
||||
|
@ -1288,6 +1288,13 @@ These options influence Texinfo output.
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
.. confval:: texinfo_no_detailmenu
|
||||
|
||||
If true, do not generate a ``@detailmenu`` in the "Top" node's menu
|
||||
containing entries for each sub-node in the document. Default is ``False``.
|
||||
|
||||
.. versionadded:: 1.2
|
||||
|
||||
.. confval:: texinfo_elements
|
||||
|
||||
A dictionary that contains Texinfo snippets that override those Sphinx
|
||||
|
@ -192,6 +192,7 @@ class Config(object):
|
||||
texinfo_elements = ({}, None),
|
||||
texinfo_domain_indices = (True, None),
|
||||
texinfo_show_urls = ('footnote', None),
|
||||
texinfo_no_detailmenu = (False, None),
|
||||
|
||||
# linkcheck options
|
||||
linkcheck_ignore = ([], None),
|
||||
|
@ -283,6 +283,9 @@ texinfo_documents = [
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#texinfo_no_detailmenu = False
|
||||
'''
|
||||
|
||||
EPUB_CONFIG = u'''
|
||||
|
@ -391,7 +391,9 @@ class TexinfoTranslator(nodes.NodeVisitor):
|
||||
return
|
||||
self.body.append('\n@menu\n')
|
||||
self.add_menu_entries(entries)
|
||||
if not self.node_menus[entries[0]]:
|
||||
if (node_name != 'Top' or
|
||||
not self.node_menus[entries[0]] or
|
||||
self.builder.config.texinfo_no_detailmenu):
|
||||
self.body.append('\n@end menu\n')
|
||||
return
|
||||
|
||||
@ -404,14 +406,12 @@ class TexinfoTranslator(nodes.NodeVisitor):
|
||||
for subentry in entries:
|
||||
_add_detailed_menu(subentry)
|
||||
|
||||
if node_name == 'Top':
|
||||
self.body.append('\n@detailmenu\n'
|
||||
' --- The Detailed Node Listing ---\n')
|
||||
self.body.append('\n@detailmenu\n'
|
||||
' --- The Detailed Node Listing ---\n')
|
||||
for entry in entries:
|
||||
_add_detailed_menu(entry)
|
||||
if node_name == 'Top':
|
||||
self.body.append('\n@end detailmenu')
|
||||
self.body.append('\n@end menu\n\n')
|
||||
self.body.append('\n@end detailmenu\n'
|
||||
'@end menu\n')
|
||||
|
||||
def tex_image_length(self, width_str):
|
||||
match = re.match('(\d*\.?\d*)\s*(\S*)', width_str)
|
||||
|
Loading…
Reference in New Issue
Block a user