[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * NEWS, doc/texinfo.texi (HTML Customization Vari
From: |
Patrice Dumas |
Subject: |
branch master updated: * NEWS, doc/texinfo.texi (HTML Customization Variables), (Other Customization Variables), tp/Texinfo/Common.pm (@variable_string_settables), tp/Texinfo/Convert/HTML.pm (%defaults) (_default_format_contents), tp/init/html32.pm: rename OVERVIEW_LINK_TO_TOC as SHORT_TOC_LINK_TO_TOC, rename BEFORE_OVERVIEW as BEFORE_SHORT_TOC_LINES and AFTER_OVERVIEW as AFTER_SHORT_TOC_LINES. |
Date: |
Wed, 05 Jan 2022 16:08:47 -0500 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 8435ae1d8b * NEWS, doc/texinfo.texi (HTML Customization Variables),
(Other Customization Variables), tp/Texinfo/Common.pm
(@variable_string_settables), tp/Texinfo/Convert/HTML.pm (%defaults)
(_default_format_contents), tp/init/html32.pm: rename OVERVIEW_LINK_TO_TOC as
SHORT_TOC_LINK_TO_TOC, rename BEFORE_OVERVIEW as BEFORE_SHORT_TOC_LINES and
AFTER_OVERVIEW as AFTER_SHORT_TOC_LINES.
8435ae1d8b is described below
commit 8435ae1d8bbf9ad474d9b4903f6f4988db5e500b
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Jan 5 22:08:36 2022 +0100
* NEWS, doc/texinfo.texi (HTML Customization Variables),
(Other Customization Variables), tp/Texinfo/Common.pm
(@variable_string_settables), tp/Texinfo/Convert/HTML.pm (%defaults)
(_default_format_contents), tp/init/html32.pm: rename OVERVIEW_LINK_TO_TOC
as SHORT_TOC_LINK_TO_TOC, rename BEFORE_OVERVIEW as BEFORE_SHORT_TOC_LINES
and AFTER_OVERVIEW as AFTER_SHORT_TOC_LINES.
* tp/Texinfo/Convert/HTML.pm (_default_format_contents): link to Table
of contents from Short table of contents only if a Table of contents
is output. Report from Benno Schulenberg.
---
ChangeLog | 13 +++++++++++
NEWS | 3 +++
doc/texinfo.texi | 25 +++++++++++-----------
tp/Texinfo/Common.pm | 6 +++---
tp/Texinfo/Convert/HTML.pm | 19 ++++++++++------
tp/init/html32.pm | 4 ++--
tp/t/results/html_tests/shortcontents_no_top.pl | 4 ++--
...t_before_top_and_summarycontents_after_title.pl | 2 +-
tp/t/results/sectioning/shortcontents.pl | 12 +++++------
9 files changed, 55 insertions(+), 33 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 945f61ed7e..33603fa5e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2022-01-05 Patrice Dumas <pertusus@free.fr>
+
+ * NEWS, doc/texinfo.texi (HTML Customization Variables),
+ (Other Customization Variables), tp/Texinfo/Common.pm
+ (@variable_string_settables), tp/Texinfo/Convert/HTML.pm (%defaults)
+ (_default_format_contents), tp/init/html32.pm: rename
OVERVIEW_LINK_TO_TOC
+ as SHORT_TOC_LINK_TO_TOC, rename BEFORE_OVERVIEW as
BEFORE_SHORT_TOC_LINES
+ and AFTER_OVERVIEW as AFTER_SHORT_TOC_LINES.
+
+ * tp/Texinfo/Convert/HTML.pm (_default_format_contents): link to Table
+ of contents from Short table of contents only if a Table of contents
+ is output. Report from Benno Schulenberg.
+
2022-01-05 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/HTML.pm
diff --git a/NEWS b/NEWS
index 76b09e5d47..88b1959002 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,9 @@ See the manual for detailed information.
. IGNORE_BEFORE_SETFILENAME customization variable removed. Always set.
. USE_XML_SYNTAX, HTML_ROOT_ELEMENT_ATTRIBUTES and NO_CUSTOM_HTML_ATTRIBUTE
customization variables added that can be used to output valid XHTML.
+ . Rename OVERVIEW_LINK_TO_TOC as SHORT_TOC_LINK_TO_TOC, rename
+ BEFORE_OVERVIEW as BEFORE_SHORT_TOC_LINES and AFTER_OVERVIEW as
+ AFTER_SHORT_TOC_LINES.
. HTML output:
. use <code> tag for the output of @t instead of <tt>
diff --git a/doc/texinfo.texi b/doc/texinfo.texi
index 3601d05c41..6adf6d49f8 100644
--- a/doc/texinfo.texi
+++ b/doc/texinfo.texi
@@ -16169,15 +16169,15 @@ beginning of each HTML file; default unset.
For HTML, when an About-element is output. If set, the corresponding
text will appear at the end of the About element; default unset.
-@item AFTER_OVERVIEW
+@item AFTER_SHORT_TOC_LINES
@itemx AFTER_TOC_LINES
If set, the corresponding text is output after the short
-table of contents for @code{AFTER_OVERVIEW} and after the table of
+table of contents for @code{AFTER_SHORT_TOC_LINES} and after the table of
contents for @code{AFTER_TOC_LINES}; otherwise, a default string is
used. At the time of writing, a @code{</div>} element is closed.
-In general, you should set @code{BEFORE_OVERVIEW} if
-@code{AFTER_OVERVIEW} is set, and you should set
+In general, you should set @code{BEFORE_SHORT_TOC_LINES} if
+@code{AFTER_SHORT_TOC_LINES} is set, and you should set
@code{BEFORE_TOC_LINES} if @code{AFTER_TOC_LINES} is set.
@item BASEFILENAME_LENGTH
@@ -16185,15 +16185,15 @@ The maximum length of a base file name; default 245.
Changing this would make cross-manual references to such long node
names invalid (@pxref{HTML Xref Link Basics}).
-@item BEFORE_OVERVIEW
+@item BEFORE_SHORT_TOC_LINES
@itemx BEFORE_TOC_LINES
If set, the corresponding text is output before the short
-table of contents for @code{BEFORE_OVERVIEW} and before the table of
+table of contents for @code{BEFORE_SHORT_TOC_LINES} and before the table of
contents for @code{BEFORE_TOC_LINES}, otherwise a default string is
used. At the time of writing, a @code{<div ...>} element is opened.
-In general you should set @code{AFTER_OVERVIEW} if
-@code{BEFORE_OVERVIEW} is set, and you should set
+In general you should set @code{AFTER_SHORT_TOC_LINES} if
+@code{BEFORE_SHORT_TOC_LINES} is set, and you should set
@code{AFTER_TOC_LINES} if @code{BEFORE_TOC_LINES} is set.
@@ -16709,10 +16709,6 @@ encoding name may be set by the output format. In
particular, the
XML-based formats use @code{utf-8} for @code{OUTPUT_ENCODING_NAME} if
the encoding is not otherwise specified. @xref{@code{@@documentencoding}}.
-@item OVERVIEW_LINK_TO_TOC
-If set, the cross-references in the Overview link to the corresponding
-Table of Contents entries; default true.
-
@item PACKAGE
@itemx PACKAGE_VERSION
@itemx PACKAGE_AND_VERSION
@@ -16734,6 +16730,11 @@ as whether the output is split. The default is unset.
Name of the program used. By default, it is set to the name of the
program launched, with a trailing @samp{.pl} removed.
+@item SHORT_TOC_LINK_TO_TOC
+If set, the cross-references in the Short table of contents links to the
+corresponding Table of Contents entries, if a Table of Contents is output;
+default true.
+
@item SORT_ELEMENT_COUNT
@pindex texi-elements-by-size
@cindex Longest nodes, finding
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 9b6ad3b56d..f909285d3d 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -262,11 +262,11 @@ our %default_converter_customization = (
my @variable_string_settables = (
'AFTER_ABOUT',
'AFTER_BODY_OPEN',
-'AFTER_OVERVIEW',
+'AFTER_SHORT_TOC_LINES',
'AFTER_TOC_LINES',
'ASCII_PUNCTUATION',
'AVOID_MENU_REDUNDANCY',
-'BEFORE_OVERVIEW',
+'BEFORE_SHORT_TOC_LINES',
'BEFORE_TOC_LINES',
'BIG_RULE',
'BODYTEXT',
@@ -326,7 +326,6 @@ my @variable_string_settables = (
'OPEN_QUOTE_SYMBOL',
'OUTPUT_ENCODING_NAME',
'OUTPUT_PERL_ENCODING',
-'OVERVIEW_LINK_TO_TOC',
'PACKAGE',
'PACKAGE_AND_VERSION',
'PACKAGE_NAME',
@@ -338,6 +337,7 @@ my @variable_string_settables = (
'PROGRAM',
'PROGRAM_NAME_IN_FOOTER',
'SECTION_NAME_IN_TITLE',
+'SHORT_TOC_LINK_TO_TOC',
'SHORTEXTN',
'SHOW_TITLE',
'SIMPLE_MENU',
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 93deb9eab6..0bcb263afa 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -1309,7 +1309,7 @@ my %defaults = (
'NODE_NAME_IN_INDEX' => 1,
'XREF_USE_NODE_NAME_ARG' => undef,
'XREF_USE_FLOAT_LABEL' => 0,
- 'OVERVIEW_LINK_TO_TOC' => 1,
+ 'SHORT_TOC_LINK_TO_TOC' => 1,
'NO_CUSTOM_HTML_ATTRIBUTE' => 0,
'COMPLEX_FORMAT_IN_TABLE' => 0,
'WORDS_IN_PAGE' => 300,
@@ -7291,12 +7291,12 @@ sub _default_format_contents($$;$$)
my $result = '';
if ($contents and !defined($self->get_conf('BEFORE_TOC_LINES'))
- or (!$contents and !defined($self->get_conf('BEFORE_OVERVIEW')))) {
+ or (!$contents and !defined($self->get_conf('BEFORE_SHORT_TOC_LINES'))))
{
$result .= $self->html_attribute_class('div', $cmdname).">\n";
} elsif($contents) {
$result .= $self->get_conf('BEFORE_TOC_LINES');
} else {
- $result .= $self->get_conf('BEFORE_OVERVIEW');
+ $result .= $self->get_conf('BEFORE_SHORT_TOC_LINES');
}
my $toplevel_contents;
@@ -7304,6 +7304,11 @@ sub _default_format_contents($$;$$)
$result .= $self->html_attribute_class('ul', $ul_class) .">\n";
$toplevel_contents = 1;
}
+
+ my $link_to_toc = (!$contents and $self->get_conf('SHORT_TOC_LINK_TO_TOC')
+ and ($self->get_conf('contents'))
+ and ($self->get_conf('CONTENTS_OUTPUT_LOCATION') ne
'inline'
+ or $self->_has_contents_or_shortcontents()));
foreach my $top_section
(@{$section_root->{'structure'}->{'section_childs'}}) {
my $section = $top_section;
SECTION:
@@ -7311,7 +7316,7 @@ sub _default_format_contents($$;$$)
if ($section->{'cmdname'} ne 'top') {
my $text = $self->command_text($section);
my $href;
- if (!$contents and $self->get_conf('OVERVIEW_LINK_TO_TOC')) {
+ if ($link_to_toc) {
$href = $self->command_contents_href($section, 'contents',
$filename);
} else {
$href = $self->command_href($section, $filename);
@@ -7386,12 +7391,12 @@ sub _default_format_contents($$;$$)
$result .= "\n</ul>";
}
if ($contents and !defined($self->get_conf('AFTER_TOC_LINES'))
- or (!$contents and !defined($self->get_conf('AFTER_OVERVIEW')))) {
+ or (!$contents and !defined($self->get_conf('AFTER_SHORT_TOC_LINES')))) {
$result .= "\n</div>\n";
} elsif($contents) {
$result .= $self->get_conf('AFTER_TOC_LINES');
} else {
- $result .= $self->get_conf('AFTER_OVERVIEW');
+ $result .= $self->get_conf('AFTER_SHORT_TOC_LINES');
}
return $result;
}
@@ -9072,7 +9077,7 @@ sub _set_variables_texi2html()
['AVOID_MENU_REDUNDANCY', 1],
['USE_ACCESSKEY', 0],
['NODE_NAME_IN_MENU', 0],
- ['OVERVIEW_LINK_TO_TOC', 0],
+ ['SHORT_TOC_LINK_TO_TOC', 0],
['USE_UP_NODE_FOR_ELEMENT_UP', 1],
['USE_REL_REV', 0],
['USE_LINKS', 0],
diff --git a/tp/init/html32.pm b/tp/init/html32.pm
index a67cb97696..1c91d7f26b 100644
--- a/tp/init/html32.pm
+++ b/tp/init/html32.pm
@@ -47,8 +47,8 @@ texinfo_set_from_init_file('FRAMESET_DOCTYPE',
texinfo_get_conf('DOCTYPE'));
texinfo_set_from_init_file('BODYTEXT', 'bgcolor="#FFFFFF" text="#000000"
link="#0000FF" vlink="#800080" alink="#FF0000"');
-texinfo_set_from_init_file('BEFORE_OVERVIEW', '');
-texinfo_set_from_init_file('AFTER_OVERVIEW', '');
+texinfo_set_from_init_file('BEFORE_SHORT_TOC_LINES', '');
+texinfo_set_from_init_file('AFTER_SHORT_TOC_LINES', '');
texinfo_set_from_init_file('BEFORE_TOC_LINES', '');
texinfo_set_from_init_file('AFTER_TOC_LINES', '');
diff --git a/tp/t/results/html_tests/shortcontents_no_top.pl
b/tp/t/results/html_tests/shortcontents_no_top.pl
index c48cb028c5..e36703d756 100644
--- a/tp/t/results/html_tests/shortcontents_no_top.pl
+++ b/tp/t/results/html_tests/shortcontents_no_top.pl
@@ -294,8 +294,8 @@ ul.no-bullet {list-style: none}
<div class="shortcontents">
<ul class="no-bullet">
-<li><a id="stoc-chap" href="#toc-chap">1 chap</a></li>
-<li><a id="stoc-chap2" href="#toc-chap2">2 chap2</a></li>
+<li><a id="stoc-chap" href="#chap">1 chap</a></li>
+<li><a id="stoc-chap2" href="#chap2">2 chap2</a></li>
</ul>
</div>
diff --git
a/tp/t/results/html_tests/text_before_top_and_summarycontents_after_title.pl
b/tp/t/results/html_tests/text_before_top_and_summarycontents_after_title.pl
index dd9ceef52a..266a512457 100644
--- a/tp/t/results/html_tests/text_before_top_and_summarycontents_after_title.pl
+++ b/tp/t/results/html_tests/text_before_top_and_summarycontents_after_title.pl
@@ -366,7 +366,7 @@ ul.no-bullet {list-style: none}
<div class="shortcontents">
<ul class="no-bullet">
-<li><a id="stoc-the-chap" href="#toc-the-chap">1 the chap</a></li>
+<li><a id="stoc-the-chap" href="#the-chap">1 the chap</a></li>
</ul>
</div>
</div>
diff --git a/tp/t/results/sectioning/shortcontents.pl
b/tp/t/results/sectioning/shortcontents.pl
index 03a58ef169..bed2d59a4c 100644
--- a/tp/t/results/sectioning/shortcontents.pl
+++ b/tp/t/results/sectioning/shortcontents.pl
@@ -804,14 +804,14 @@ ul.no-bullet {list-style: none}
<div class="shortcontents">
<ul class="no-bullet">
<li><ul class="no-bullet">
-<li><a id="stoc-chapter" href="#toc-chapter">1 chapter</a></li>
+<li><a id="stoc-chapter" href="#chapter">1 chapter</a></li>
</ul></li>
-<li><a id="stoc-part" href="#toc-part">part</a><ul class="no-bullet">
-<li><a id="stoc-chapter-in-part" href="#toc-chapter-in-part">2 chapter in
part</a></li>
-<li><a id="stoc-second-chapter-in-part" href="#toc-second-chapter-in-part">3
second chapter in part</a></li>
-<li><a id="stoc-unnumbered" href="#toc-unnumbered">unnumbered</a></li>
+<li><a id="stoc-part" href="#part">part</a><ul class="no-bullet">
+<li><a id="stoc-chapter-in-part" href="#chapter-in-part">2 chapter in
part</a></li>
+<li><a id="stoc-second-chapter-in-part" href="#second-chapter-in-part">3
second chapter in part</a></li>
+<li><a id="stoc-unnumbered" href="#unnumbered">unnumbered</a></li>
</ul></li>
-<li><a id="stoc-appendix" href="#toc-appendix">Appendix A appendix</a></li>
+<li><a id="stoc-appendix" href="#appendix">Appendix A appendix</a></li>
</ul>
</div>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * NEWS, doc/texinfo.texi (HTML Customization Variables), (Other Customization Variables), tp/Texinfo/Common.pm (@variable_string_settables), tp/Texinfo/Convert/HTML.pm (%defaults) (_default_format_contents), tp/init/html32.pm: rename OVERVIEW_LINK_TO_TOC as SHORT_TOC_LINK_TO_TOC, rename BEFORE_OVERVIEW as BEFORE_SHORT_TOC_LINES and AFTER_OVERVIEW as AFTER_SHORT_TOC_LINES.,
Patrice Dumas <=
- Prev by Date:
branch master updated: * tp/Texinfo/Convert/HTML.pm (%special_list_bullet_css_string_no_arg_command) (html_convert_css_string_for_list_bullet): allow formatting for list bullets to be different from formatting of @-commands in CSS strings. This was an attempt to find an hyphen more suitable for a bullet list, but the default one seems to be the best.
- Next by Date:
branch master updated: * tp/Texinfo/Common.pm (@variable_other_settables), tp/Texinfo/Convert/HTML.pm (%contents_command_element_type) (command_contents_href, command_text, %defaults, _translate_names) (_contents_inline_element, _convert_special_element_type) (_html_set_pages_files, _prepare_special_elements, _prepare_contents_elements) (_default_format_footnotes_text) (_default_format_special_element_body): distinguish special element types and special elements directions.
- Previous by thread:
branch master updated: * tp/Texinfo/Convert/HTML.pm (%special_list_bullet_css_string_no_arg_command) (html_convert_css_string_for_list_bullet): allow formatting for list bullets to be different from formatting of @-commands in CSS strings. This was an attempt to find an hyphen more suitable for a bullet list, but the default one seems to be the best.
- Next by thread:
branch master updated: * tp/Texinfo/Common.pm (@variable_other_settables), tp/Texinfo/Convert/HTML.pm (%contents_command_element_type) (command_contents_href, command_text, %defaults, _translate_names) (_contents_inline_element, _convert_special_element_type) (_html_set_pages_files, _prepare_special_elements, _prepare_contents_elements) (_default_format_footnotes_text) (_default_format_special_element_body): distinguish special element types and special elements directions.
- Index(es):