texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Patrice Dumas
Date: Tue, 8 Nov 2022 03:29:30 -0500 (EST)

branch: master
commit 2fcb5f23aaeccbe750759560a95003fe993a42dc
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 6 13:05:09 2022 +0100

    Do not use FirstInFile in direction strings, document FirstInFile
    
    * tp/Texinfo/Convert/HTML.pm (direction_string): strip leading
    FirstInFile from direction when looking for the associated strings.
    
    * doc/texi2any_api.texi (Directions, Direction Strings): document
    directions with FirstInFile prepended.
---
 ChangeLog                                          | 10 ++++++++++
 doc/texi2any_api.texi                              | 23 ++++++++++++++++++++--
 tp/Texinfo/Convert/HTML.pm                         | 20 ++-----------------
 .../res_html/Chapter-de.html                       |  2 +-
 .../res_html/Chapter-fr.html                       |  2 +-
 .../customize_translations/res_html/Chapter.html   |  2 +-
 6 files changed, 36 insertions(+), 23 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ac9e8c9cc2..f49b24ebe6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-11-05  Patrice Dumas  <pertusus@free.fr>
+
+       Do not use FirstInFile in direction strings, document FirstInFile
+
+       * tp/Texinfo/Convert/HTML.pm (direction_string): strip leading
+       FirstInFile from direction when looking for the associated strings.
+
+       * doc/texi2any_api.texi (Directions, Direction Strings): document
+       directions with FirstInFile prepended.
+
 2022-11-05  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Structuring.pm (check_nodes_are_referenced): consider
diff --git a/doc/texi2any_api.texi b/doc/texi2any_api.texi
index ff9f356d54..68c6774c0b 100644
--- a/doc/texi2any_api.texi
+++ b/doc/texi2any_api.texi
@@ -872,14 +872,14 @@ associated with a button (@pxref{Simple Navigation Panel 
Customization}).
 
 Each element direction has a name and a reference to the element unit they
 point to, when such an element exists.  The element is either a
-global element unit (for example, the first element) or relative to the
+global element unit (for example, the Top element) or relative to the
 current element unit (for example, the next element unit).  Such relative
 elements are determined with respect to the document structure defined
 by the section structuring commands (@code{@@chapter},
 @code{@@unnumbered}@dots{}) or by the nodes if the node pointers are
 specified on @code{@@node} lines or in menus (@pxref{Two Paths,,, texinfo, 
Texinfo}).
 
-Here is the list of element units directions:
+Here is the list of global element units directions:
 
 @table @emph
 @item @samp{@ }
@@ -904,6 +904,11 @@ Units}).
 @item Index
 The first element unit with @code{@@printindex}.
 
+@end table
+
+Here is the list of relative element units directions:
+
+@table @emph
 @item This
 The current element unit.
 
@@ -960,6 +965,15 @@ Up node element unit.
 
 @end table
 
+@cindex @code{FirstInFile} direction variant
+@anchor{@code{FirstInFile} direction variant}
+Relative direction elements are each associated to a variant, with
+@samp{FirstInFile} prepended, which points to the direction relative
+to the first element in file.  For example, @code{FirstInFileNodeNext}
+is the next node element relative to the first element in file.  The
+@samp{FirstInFile} directions are usually used in footers.
+
+
 @node Element Direction Information Type
 @subsection Element Direction Information Type
 
@@ -1041,6 +1055,11 @@ Direction text in a few words.
 @samp{button}, @samp{description} and @samp{text} are translated based
 on the document language.
 
+The @code{FirstInFile} direction variants are associated with the same
+strings as the direction they are prepended to (@pxref{@code{FirstInFile}
+direction variant}).  For example @code{FirstInFileNodeNext} is associated
+with the same strings as @code{NodeNext}.
+
 
 @node Direction Strings Customization
 @section Direction Strings Customization
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index e396c73882..3035878512 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -1405,6 +1405,8 @@ sub direction_string($$$;$)
     return undef;
   }
 
+  $direction =~ s/^FirstInFile//;
+
   if (not exists($self->{'directions_strings'}->{$string_type}->{$direction})
       or not exists($self->{'directions_strings'}->{$string_type}
                                                  ->{$direction}->{$context})) {
@@ -2034,15 +2036,6 @@ my %default_converted_directions_strings = (
    },
 );
 
-foreach my $string_type (keys(%default_converted_directions_strings)) {
-  foreach my $button (grep
-                 {not exists($global_and_special_directions{$_}) and $_ ne ' '}
-                 keys %{$default_converted_directions_strings{$string_type}}) {
-    
$default_converted_directions_strings{$string_type}->{'FirstInFile'.$button}
-      = $default_converted_directions_strings{$string_type}->{$button};
-  }
-}
-
 my %default_translated_directions_strings = (
   'text' => {
      ' ' =>           {'converted' => ' '.$html_default_entity_nbsp.' '},
@@ -2126,15 +2119,6 @@ my %default_translated_directions_strings = (
   }
 );
 
-foreach my $string_type (keys(%default_translated_directions_strings)) {
-  foreach my $button (grep
-                 {not exists($global_and_special_directions{$_}) and $_ ne ' '}
-                 keys %{$default_translated_directions_strings{$string_type}}) 
{
-    
$default_translated_directions_strings{$string_type}->{'FirstInFile'.$button}
-      = $default_translated_directions_strings{$string_type}->{$button};
-  }
-}
-
 sub _translate_names($)
 {
   my $self = shift;
diff --git 
a/tp/t/results/init_files_tests/customize_translations/res_html/Chapter-de.html 
b/tp/t/results/init_files_tests/customize_translations/res_html/Chapter-de.html
index 37c2f7457b..0849b4ad93 100644
--- 
a/tp/t/results/init_files_tests/customize_translations/res_html/Chapter-de.html
+++ 
b/tp/t/results/init_files_tests/customize_translations/res_html/Chapter-de.html
@@ -34,7 +34,7 @@ Nächster Knoten: <a href="Last-chapter.html" accesskey="n" 
rel="next">Last Chap
 <hr>
 <div class="nav-panel">
 <p>
-Nächste: <a href="Last-chapter.html" accesskey="n" rel="next">Last 
Chapter</a>, Vorige: <a href="Chapter-fr.html#Chapter-fr" accesskey="p" 
rel="prev">chap fr</a>, Nach oben: <a href="index.html" accesskey="u" 
rel="up">top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Das 
Inhaltsverzeichnis" rel="contents">Inhalt</a>] &nbsp; [<a 
href="Last-chapter.html" title="Nächster Abschnitt in Lesereihenfolge" 
accesskey="n" rel="next">Nach vorne &gt;</a>]</p>
+Nächster Knoten: <a href="Last-chapter.html" accesskey="n" rel="next">Last 
Chapter</a>, Vorige: <a href="Chapter-fr.html#Chapter-fr" accesskey="p" 
rel="prev">chap fr</a>, Nach oben: <a href="index.html" accesskey="u" 
rel="up">top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Das 
Inhaltsverzeichnis" rel="contents">Inhalt</a>] &nbsp; [<a 
href="Last-chapter.html" title="Nächster Abschnitt in Lesereihenfolge" 
accesskey="n" rel="next">Nach vorne &rArr;</a>]</p>
 </div>
 
 
diff --git 
a/tp/t/results/init_files_tests/customize_translations/res_html/Chapter-fr.html 
b/tp/t/results/init_files_tests/customize_translations/res_html/Chapter-fr.html
index 8128ed0ae1..ddc938d23c 100644
--- 
a/tp/t/results/init_files_tests/customize_translations/res_html/Chapter-fr.html
+++ 
b/tp/t/results/init_files_tests/customize_translations/res_html/Chapter-fr.html
@@ -46,7 +46,7 @@ Monter: <a href="#Chapter-fr" accesskey="u" rel="up">chap 
fr</a> &nbsp; [<a href
 <hr>
 <div class="nav-panel">
 <p>
-Nächste: <a href="Chapter-de.html" accesskey="n" rel="next">chap de</a>, 
Vorige: <a href="Chapter.html" accesskey="p" rel="prev">chap</a>, Nach oben: <a 
href="index.html" accesskey="u" rel="up">top</a> &nbsp; [<a 
href="index.html#SEC_Contents" title="Das Inhaltsverzeichnis" 
rel="contents">Inhalt</a>] &nbsp; [<a href="#section-fr" title="Nächster 
Abschnitt in Lesereihenfolge" accesskey="n" rel="next">Nach vorne &gt;</a>]</p>
+Nächster Knoten: <a href="Chapter-de.html" accesskey="n" rel="next">chap 
de</a>, Vorige: <a href="Chapter.html" accesskey="p" rel="prev">chap</a>, Nach 
oben: <a href="index.html" accesskey="u" rel="up">top</a> &nbsp; [<a 
href="index.html#SEC_Contents" title="Das Inhaltsverzeichnis" 
rel="contents">Inhalt</a>] &nbsp; [<a href="#section-fr" title="Nächster 
Abschnitt in Lesereihenfolge" accesskey="n" rel="next">Nach vorne 
&rArr;</a>]</p>
 </div>
 
 
diff --git 
a/tp/t/results/init_files_tests/customize_translations/res_html/Chapter.html 
b/tp/t/results/init_files_tests/customize_translations/res_html/Chapter.html
index 9f1a7d95f5..33f25f5ae4 100644
--- a/tp/t/results/init_files_tests/customize_translations/res_html/Chapter.html
+++ b/tp/t/results/init_files_tests/customize_translations/res_html/Chapter.html
@@ -34,7 +34,7 @@
 <hr>
 <div class="nav-panel">
 <p>
-Suivant: <a href="Chapter-fr.html#Chapter-fr" accesskey="n" rel="next">chap 
fr</a>, Pr&eacute;c&eacute;dent: <a href="index.html" accesskey="p" 
rel="prev">top</a>, Monter: <a href="index.html" accesskey="u" rel="up">top</a> 
&nbsp; [<a href="index.html#SEC_Contents" title="La Table des mati&egrave;res" 
rel="contents">Table des mati&egrave;res</a>] &nbsp; [<a 
href="Chapter-fr.html#Chapter-fr" title="Section suivante dans l&rsquo;ordre de 
lecture" accesskey="n" rel="next">Vers l'avant &gt;< [...]
+N&oelig; suivant: <a href="Chapter-fr.html#Chapter-fr" accesskey="n" 
rel="next">chap fr</a>, Pr&eacute;c&eacute;dent: <a href="index.html" 
accesskey="p" rel="prev">top</a>, Monter: <a href="index.html" accesskey="u" 
rel="up">top</a> &nbsp; [<a href="index.html#SEC_Contents" title="La Table des 
mati&egrave;res" rel="contents">Table des mati&egrave;res</a>] &nbsp; [<a 
href="Chapter-fr.html#Chapter-fr" title="Section suivante dans l&rsquo;ordre de 
lecture" accesskey="n" rel="next">Vers l&rs [...]
 </div>
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]