texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Convert/HTML.pm, doc/texi2any_api.te


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/HTML.pm, doc/texi2any_api.texi: remove/handle FIXMEs.
Date: Sun, 18 Feb 2024 06:46:14 -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 01d5c2271e * tp/Texinfo/Convert/HTML.pm, doc/texi2any_api.texi: 
remove/handle FIXMEs.
01d5c2271e is described below

commit 01d5c2271e673468ce172ce775e2b802a4a6f375
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Feb 18 12:46:10 2024 +0100

    * tp/Texinfo/Convert/HTML.pm, doc/texi2any_api.texi: remove/handle
    FIXMEs.
    
    * tp/Makefile.tres, tp/t/html_tests.t (menu_in_documentdescription):
    add a test of menu in documentdescription, which leads to menu being
    formatted in string context.
---
 ChangeLog                                          |   9 +
 doc/texi2any_api.texi                              |   3 +
 tp/Makefile.tres                                   |   1 +
 tp/Texinfo/Convert/HTML.pm                         |  23 +-
 tp/t/html_tests.t                                  |  11 +
 .../html_tests/menu_in_documentdescription.pl      | 353 +++++++++++++++++++++
 6 files changed, 387 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1c1489f40f..45653af240 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-02-18  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/HTML.pm, doc/texi2any_api.texi: remove/handle
+       FIXMEs.
+
+       * tp/Makefile.tres, tp/t/html_tests.t (menu_in_documentdescription):
+       add a test of menu in documentdescription, which leads to menu being
+       formatted in string context.
+
 2024-02-18  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/HTML.pm (_convert_heading_command),
diff --git a/doc/texi2any_api.texi b/doc/texi2any_api.texi
index 4a90706648..b3a7166440 100644
--- a/doc/texi2any_api.texi
+++ b/doc/texi2any_api.texi
@@ -1324,6 +1324,9 @@ the @code{rel} attribute is used in navigation.  In that 
case the
 @code{rel} direction string is used for the @code{rel}
 attribute (@pxref{Direction Strings}).
 
+Leading space buttons mixed with directions not found may be omitted
+of the navigation panel output.
+
 
 @node User Defined Functions
 @chapter User Defined Functions
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index 72ea987d21..98050426e6 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -678,6 +678,7 @@ test_files_generated_list = 
$(test_tap_files_generated_list) \
   t/results/html_tests/mathjax_with_texinfo_html_text.pl \
   t/results/html_tests/mathjax_with_texinfo_no_convert_to_latex.pl \
   t/results/html_tests/menu.pl \
+  t/results/html_tests/menu_in_documentdescription.pl \
   t/results/html_tests/menu_in_example.pl \
   t/results/html_tests/no_content.pl \
   t/results/html_tests/no_content/res_html \
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 3da453e087..cae802bc1c 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -4459,9 +4459,8 @@ sub _default_format_button($$;$)
           $passive_icon = $passive_icons->{$button};
         }
         if (defined($passive_icon) and $passive_icon ne '') {
-          # FIXME strip FirstInFile from $button to get $passive_icon?
           my $button_name_string = $self->direction_string($button,
-                                                         'button', 'string');
+                                                           'button', 'string');
           $passive = &{$self->formatting_function('format_button_icon_img')}(
                       $self, $button_name_string, $passive_icon,
                       $self->from_element_direction($button, 'string'));
@@ -4516,7 +4515,6 @@ sub _default_format_navigation_panel($$$$;$)
       $direction = $button;
     }
     # if the first button is an empty button, pass
-    # FIXME check if documented, if not, document
     if (defined($direction)
         and $direction eq ' ' and $nr_of_buttons_shown == 0) {
       next;
@@ -5538,9 +5536,9 @@ sub _convert_menu_command($$$$$)
   if ($content !~ /\S/) {
     return '';
   }
-  # This can probably only happen with incorrect input,
-  # for instance menu in copying
-  # FIXME check?
+  # This can probably only happen with incorrect input.  It happens with
+  # menu in documentdescription.  It does not seem that it could happen
+  # in other situation with a Texinfo tree parsed from Texinfo code.
   if (in_string($self)) {
     return $content;
   }
@@ -9060,9 +9058,8 @@ sub convert_tree($$;$)
   return $self->_convert($tree, $explanation);
 }
 
-# FIXME make it a format_* function?
-# protect an url, in which characters with specific meaning in url are 
considered
-# to have their specific meaning
+# Protect an url, in which characters with specific meaning in url are
+# considered to have their specific meaning.
 # TODO turn end of lines to spaces?  Currently, an end of line is percent
 # protected, it is most likely not what the author intended.  Tested in
 # html_tests.t end_of_line_in_uref
@@ -9078,8 +9075,7 @@ sub url_protect_url_text($$)
   return &{$self->formatting_function('format_protect_text')}($self, $href);
 }
 
-# FIXME make it a format_* function?
-# protect a file path used in an url.  Characters appearing in file paths
+# Protect a file path used in an url.  Characters appearing in file paths
 # are not protected.   All the other characters that can be percent
 # protected are protected, including characters with specific meaning in url.
 sub url_protect_file_text($$)
@@ -13015,8 +13011,9 @@ sub output($$)
 }
 
 #my $characters_replaced_from_class_names = quotemeta('[](),~#:/\\@+=!;.,?* ');
-# FIXME not clear what character should be allowed and which ones replaced
-# besides space
+# Not clear what character should be allowed and which ones replaced
+# besides space.  Not really important as the caller should themselves
+# sanitize the class names already.
 my $characters_replaced_from_class_names = quotemeta(' ');
 sub _protect_class_name($$)
 {
diff --git a/tp/t/html_tests.t b/tp/t/html_tests.t
index 986c4cbb9d..fa7adcb7dc 100644
--- a/tp/t/html_tests.t
+++ b/tp/t/html_tests.t
@@ -289,6 +289,17 @@ in @code{documentdescri---ption} --- @bullet{} @enddots{} 
@verb{:"verb:} @aa{} @
 
 @top top
 '],
+['menu_in_documentdescription',
+'@node Top
+@top top
+
+@documentdescription
+@menu
+* (f)b::
+@end menu
+@end documentdescription
+', {'FORMAT_MENU' => 'menu'},
+   {'FORMAT_MENU' => 'menu'}],
 ['index_below',
 '@top top
 
diff --git a/tp/t/results/html_tests/menu_in_documentdescription.pl 
b/tp/t/results/html_tests/menu_in_documentdescription.pl
new file mode 100644
index 0000000000..a2f74bac60
--- /dev/null
+++ b/tp/t/results/html_tests/menu_in_documentdescription.pl
@@ -0,0 +1,353 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors 
+   %result_indices %result_sectioning %result_nodes %result_menus
+   %result_floats %result_converted %result_converted_errors 
+   %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'menu_in_documentdescription'} = {
+  'contents' => [
+    {
+      'type' => 'before_node_section'
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'text' => 'Top'
+            }
+          ],
+          'info' => {
+            'spaces_after_argument' => {
+              'text' => '
+'
+            }
+          },
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'node',
+      'extra' => {
+        'is_target' => 1,
+        'normalized' => 'Top'
+      },
+      'info' => {
+        'spaces_before_argument' => {
+          'text' => ' '
+        }
+      },
+      'source_info' => {
+        'line_nr' => 1
+      }
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'text' => 'top'
+            }
+          ],
+          'info' => {
+            'spaces_after_argument' => {
+              'text' => '
+'
+            }
+          },
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'top',
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'empty_line'
+        },
+        {
+          'args' => [
+            {
+              'info' => {
+                'spaces_after_argument' => {
+                  'text' => '
+'
+                }
+              },
+              'type' => 'block_line_arg'
+            }
+          ],
+          'cmdname' => 'documentdescription',
+          'contents' => [
+            {
+              'args' => [
+                {
+                  'info' => {
+                    'spaces_after_argument' => {
+                      'text' => '
+'
+                    }
+                  },
+                  'type' => 'block_line_arg'
+                }
+              ],
+              'cmdname' => 'menu',
+              'contents' => [
+                {
+                  'contents' => [
+                    {
+                      'text' => '* ',
+                      'type' => 'menu_entry_leading_text'
+                    },
+                    {
+                      'contents' => [
+                        {
+                          'text' => '('
+                        },
+                        {
+                          'text' => 'f'
+                        },
+                        {
+                          'text' => ')'
+                        },
+                        {
+                          'text' => 'b'
+                        }
+                      ],
+                      'extra' => {
+                        'manual_content' => {
+                          'contents' => [
+                            {}
+                          ]
+                        },
+                        'node_content' => {
+                          'contents' => [
+                            {}
+                          ]
+                        },
+                        'normalized' => 'b'
+                      },
+                      'type' => 'menu_entry_node'
+                    },
+                    {
+                      'text' => '::',
+                      'type' => 'menu_entry_separator'
+                    },
+                    {
+                      'contents' => [
+                        {
+                          'contents' => [
+                            {
+                              'text' => '
+'
+                            }
+                          ],
+                          'type' => 'preformatted'
+                        }
+                      ],
+                      'type' => 'menu_entry_description'
+                    }
+                  ],
+                  'source_info' => {
+                    'line_nr' => 6
+                  },
+                  'type' => 'menu_entry'
+                },
+                {
+                  'args' => [
+                    {
+                      'contents' => [
+                        {
+                          'text' => 'menu'
+                        }
+                      ],
+                      'info' => {
+                        'spaces_after_argument' => {
+                          'text' => '
+'
+                        }
+                      },
+                      'type' => 'line_arg'
+                    }
+                  ],
+                  'cmdname' => 'end',
+                  'extra' => {
+                    'text_arg' => 'menu'
+                  },
+                  'info' => {
+                    'spaces_before_argument' => {
+                      'text' => ' '
+                    }
+                  },
+                  'source_info' => {
+                    'line_nr' => 7
+                  }
+                }
+              ],
+              'source_info' => {
+                'line_nr' => 5
+              }
+            },
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'text' => 'documentdescription'
+                    }
+                  ],
+                  'info' => {
+                    'spaces_after_argument' => {
+                      'text' => '
+'
+                    }
+                  },
+                  'type' => 'line_arg'
+                }
+              ],
+              'cmdname' => 'end',
+              'extra' => {
+                'text_arg' => 'documentdescription'
+              },
+              'info' => {
+                'spaces_before_argument' => {
+                  'text' => ' '
+                }
+              },
+              'source_info' => {
+                'line_nr' => 8
+              }
+            }
+          ],
+          'source_info' => {
+            'line_nr' => 4
+          }
+        }
+      ],
+      'extra' => {},
+      'info' => {
+        'spaces_before_argument' => {
+          'text' => ' '
+        }
+      },
+      'source_info' => {
+        'line_nr' => 2
+      }
+    }
+  ],
+  'type' => 'document_root'
+};
+$result_trees{'menu_in_documentdescription'}{'contents'}[2]{'contents'}[1]{'contents'}[0]{'contents'}[0]{'contents'}[1]{'extra'}{'manual_content'}{'contents'}[0]
 = 
$result_trees{'menu_in_documentdescription'}{'contents'}[2]{'contents'}[1]{'contents'}[0]{'contents'}[0]{'contents'}[1]{'contents'}[1];
+$result_trees{'menu_in_documentdescription'}{'contents'}[2]{'contents'}[1]{'contents'}[0]{'contents'}[0]{'contents'}[1]{'extra'}{'node_content'}{'contents'}[0]
 = 
$result_trees{'menu_in_documentdescription'}{'contents'}[2]{'contents'}[1]{'contents'}[0]{'contents'}[0]{'contents'}[1]{'contents'}[3];
+
+$result_texis{'menu_in_documentdescription'} = '@node Top
+@top top
+
+@documentdescription
+@menu
+* (f)b::
+@end menu
+@end documentdescription
+';
+
+
+$result_texts{'menu_in_documentdescription'} = 'top
+***
+
+';
+
+$result_sectioning{'menu_in_documentdescription'} = {
+  'extra' => {
+    'section_childs' => [
+      {
+        'cmdname' => 'top',
+        'extra' => {
+          'associated_node' => {
+            'cmdname' => 'node',
+            'extra' => {
+              'normalized' => 'Top'
+            }
+          },
+          'section_level' => 0,
+          'sectioning_root' => {}
+        }
+      }
+    ],
+    'section_level' => -1
+  }
+};
+$result_sectioning{'menu_in_documentdescription'}{'extra'}{'section_childs'}[0]{'extra'}{'sectioning_root'}
 = $result_sectioning{'menu_in_documentdescription'};
+
+$result_nodes{'menu_in_documentdescription'} = [
+  {
+    'cmdname' => 'node',
+    'extra' => {
+      'associated_section' => {
+        'cmdname' => 'top',
+        'extra' => {}
+      },
+      'normalized' => 'Top'
+    }
+  }
+];
+
+$result_menus{'menu_in_documentdescription'} = [
+  {
+    'extra' => {
+      'normalized' => 'Top'
+    }
+  }
+];
+
+$result_errors{'menu_in_documentdescription'} = [
+  {
+    'error_line' => 'warning: @menu in invalid context
+',
+    'line_nr' => 5,
+    'text' => '@menu in invalid context',
+    'type' => 'warning'
+  }
+];
+
+
+$result_floats{'menu_in_documentdescription'} = {};
+
+
+
+$result_converted{'html'}->{'menu_in_documentdescription'} = '<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>top</title>
+
+<meta name="description" content="&bull; (f)b::">
+<meta name="keywords" content="top">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span:hover a.copiable-link {visibility: visible}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="top-level-extent" id="Top">
+<h1 class="top" id="top"><span>top<a class="copiable-link" href="#top"> 
&para;</a></span></h1>
+
+</div>
+
+
+
+</body>
+</html>
+';
+
+1;



reply via email to

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