texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Sat, 21 Oct 2023 17:04:41 -0400 (EDT)

branch: master
commit 55e65067b963b6d8f6024033a3e1c4e7a9b03ea9
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Oct 21 22:56:17 2023 +0200

    Remove HTML frames output, FRAMES and FRAMESET_DOCTYPE customization options
    
    * NEWS, doc/texinfo.texi (HTML Customization Variables)
    (@command{texi2html}), tp/Texinfo/Convert/HTML.pm (%defaults),
    (_prepare_units_directions_files, output),
    tp/Texinfo/options_data.txt, tp/init/html32.pm, tp/t/html_tests.t
    (sectioning_frames): remove FRAMES and FRAMESET_DOCTYPE customization
    options, and frames output related code, mainly
    _prepare_frames_filenames and _default_format_frame_files.
---
 ChangeLog                                          |  12 ++
 NEWS                                               |   1 +
 doc/texi2any_api.texi                              |   3 -
 doc/texinfo.texi                                   |  12 +-
 tp/Texinfo/Convert/HTML.pm                         | 149 ---------------------
 tp/Texinfo/options_data.txt                        |   2 -
 tp/init/html32.pm                                  |   2 -
 tp/t/html_tests.t                                  |   3 +-
 .../res_html/sectioning_frame.html                 |   8 --
 .../sectioning_frames/res_html/sectioning_ovr.html |  54 --------
 .../res_html/sectioning_toc_frame.html             |  32 -----
 11 files changed, 16 insertions(+), 262 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6f67eb2db7..b74a274ebd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2023-10-21  Patrice Dumas  <pertusus@free.fr>
+
+       Remove HTML frames output, FRAMES and FRAMESET_DOCTYPE customization 
options
+
+       * NEWS, doc/texinfo.texi (HTML Customization Variables)
+       (@command{texi2html}), tp/Texinfo/Convert/HTML.pm (%defaults),
+       (_prepare_units_directions_files, output),
+       tp/Texinfo/options_data.txt, tp/init/html32.pm, tp/t/html_tests.t
+       (sectioning_frames): remove FRAMES and FRAMESET_DOCTYPE customization
+       options, and frames output related code, mainly
+       _prepare_frames_filenames and _default_format_frame_files.
+
 2023-10-21  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/utils.h (FILE_SOURCE_INFO,
diff --git a/NEWS b/NEWS
index 21a4966f0b..6d14669f91 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ See the manual for detailed information.
    processed.
 * texi2any
  . remove SIMPLE_MENU customization option and tree transformation.
+ . remove FRAMES and FRAMESET_DOCTYPE customization options.
 
 
 7.1 (18 October 2023)
diff --git a/doc/texi2any_api.texi b/doc/texi2any_api.texi
index 67847a699f..c0136f1cb9 100644
--- a/doc/texi2any_api.texi
+++ b/doc/texi2any_api.texi
@@ -4303,9 +4303,6 @@ HTML cross manual references (@pxref{HTML Xref,,, 
texinfo, Texinfo}).
 Returns the content of the node redirection file.
 @end deftypefn
 
-@c NOTE format_frame_files is not documented, we do not want users to use/set 
this
-@c we want frames to disappear
-
 
 @node Specific Functions for Specific Elements
 @appendix Specific Functions for Specific Elements
diff --git a/doc/texinfo.texi b/doc/texinfo.texi
index 4b9367451f..06acf9dbee 100644
--- a/doc/texinfo.texi
+++ b/doc/texinfo.texi
@@ -15677,14 +15677,6 @@ Header formatting level used for the footnotes header 
with
 the `separate' footnotestyle; default @samp{4}.  @xref{Footnote
 Styles}.
 
-@item FRAMES
-If set, a file describing the frame layout is generated,
-together with a file with the short table of contents; default false.
-
-@item FRAMESET_DOCTYPE
-Same as DOCTYPE, but for the file containing the frame
-description.
-
 @item HEADER_IN_TABLE
 Use tables for header formatting rather than a simple
 @code{<div>} element; default false.
@@ -16780,11 +16772,11 @@ corresponding @command{texi2any} customization 
variables.
 @item @option{--use-nodes}            @tab @code{USE_NODES}
 @item @option{--monolithic}           @tab @code{MONOLITHIC}
 @item @option{--top-file}             @tab @code{TOP_FILE}
-@item @option{--frames}               @tab @code{FRAMES}
+@item @option{--frames}               @tab no equivalent
 @item @option{--menu}                 @tab @code{FORMAT_MENU}
 @item @option{--debug}                @tab @code{DEBUG}
 @item @option{--doctype}              @tab @code{DOCTYPE}
-@item @option{--frameset-doctype}     @tab @code{FRAMESET_DOCTYPE}
+@item @option{--frameset-doctype}     @tab no equivalent
 @item @option{--test}                 @tab @code{TEST}
 @end multitable
 
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index f8e7d922d8..507e977ae5 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -1943,9 +1943,6 @@ my %defaults = (
   'XREF_USE_FLOAT_LABEL'   => 0,
   'xrefautomaticsectiontitle' => 'on',
 
-  # obsolete
-  'FRAMESET_DOCTYPE'      => '<!DOCTYPE html>',
-
   # Non-string customization variables
   # _default_panel_button_dynamic_direction use nodes direction based on 
USE_NODE_DIRECTIONS
   # or USE_NODES if USE_NODE_DIRECTIONS is undefined
@@ -1965,11 +1962,6 @@ my %defaults = (
                              ' ', 'Contents', 'Index'],
   'ACTIVE_ICONS'         => undef,
   'PASSIVE_ICONS'        => undef,
-  # obsolete
-  'frame_pages_file_string' => {
-                              'Frame' => '_frame',
-                              'Toc_Frame' => '_toc_frame',
-                              },
 
 );
 
@@ -7512,7 +7504,6 @@ foreach my $customized_reference 
('external_target_split_name',
      'format_element_header' => \&_default_format_element_header,
      'format_element_footer' => \&_default_format_element_footer,
      'format_end_file' => \&_default_format_end_file,
-     'format_frame_files' => \&_default_format_frame_files,
      'format_footnotes_segment' => \&_default_format_footnotes_segment,
      'format_footnotes_sequence' => \&_default_format_footnotes_sequence,
      'format_heading_text' => \&_default_format_heading_text,
@@ -9332,8 +9323,6 @@ sub _prepare_units_directions_files($$$$$$$$)
   # Here such that PrevFile and NextFile can be set.
   Texinfo::Structuring::units_file_directions($output_units);
 
-  $self->_prepare_frames_filenames($document_name);
-
   # elements_in_file_count is only set in HTML, not in
   # Texinfo::Convert::Converter
   $self->{'elements_in_file_count'} = {};
@@ -9703,29 +9692,6 @@ sub _prepare_output_units_global_targets($$$$)
   }
 }
 
-sub _prepare_frames_filenames($$)
-{
-  my $self = shift;
-  my $document_name = shift;
-
-  if ($self->get_conf('FRAMES')) {
-
-    my $extension = '';
-    $extension = $self->get_conf('EXTENSION')
-      if (defined($self->get_conf('EXTENSION')));
-
-    $self->{'frame_pages_filenames'} = {};
-    foreach my $frame_type (keys(%{$self->{'frame_pages_file_string'}})) {
-      my $filename;
-      $filename = $document_name.
-        $self->{'frame_pages_file_string'}->{$frame_type};
-      $filename .= '.'.$extension if (defined($extension));
-
-      $self->{'frame_pages_filenames'}->{$frame_type} = $filename;
-    }
-  }
-}
-
 sub _XS_sort_sortable_index_entries_by_letter($$)
 {
 }
@@ -10916,111 +10882,6 @@ __("cannot use absolute path or URL `%s' for 
JS_WEBLABELS_FILE when generating w
   }
 }
 
-# FIXME the file opening should be done in main program, only
-# the formatting should be done in customization function.  Frames
-# are deprecated in HTML, however, and therefore there is no point
-# in investing time in better code to produce them.
-sub _default_format_frame_files($$)
-{
-  my $self = shift;
-  my $destination_directory = shift;
-
-  my $frame_file = $self->{'frame_pages_filenames'}->{'Frame'};
-  my $frame_outfile;
-  if (defined($destination_directory) and $destination_directory ne '') {
-    $frame_outfile = File::Spec->catfile($destination_directory,
-                                         $frame_file);
-  } else {
-    $frame_outfile = $frame_file;
-  }
-
-  my $toc_frame_file = $self->{'frame_pages_filenames'}->{'Toc_Frame'};
-  my $toc_frame_outfile;
-  if (defined($destination_directory) and $destination_directory ne '') {
-    $toc_frame_outfile = File::Spec->catfile($destination_directory,
-                                             $toc_frame_file);
-  } else {
-    $toc_frame_outfile = $toc_frame_file;
-  }
-  # sequence of bytes
-  my ($frame_file_path, $frame_path_encoding)
-     = $self->encoded_output_file_name($frame_outfile);
-  my ($frame_fh, $error_message_frame) = 
Texinfo::Common::output_files_open_out(
-                     $self->output_files_information(), $self, 
$frame_file_path);
-  if (defined($frame_fh)) {
-    my $doctype = $self->get_conf('FRAMESET_DOCTYPE');
-    my $root_html_element_attributes = 
$self->_root_html_element_attributes_string();
-    my $top_file = '';
-    my $top_element = $self->global_direction_unit('Top');
-    if ($top_element) {
-      $top_file = $top_element->{'unit_filename'};
-    }
-    my $title = $self->{'title_string'};
-    print $frame_fh <<EOT;
-$doctype
-<html${root_html_element_attributes}>
-<head><title>$title</title></head>
-<frameset cols="140,*">
-  <frame name="toc" src="$toc_frame_file">
-  <frame name="main" src="$top_file">
-</frameset>
-</html>
-EOT
-
-    Texinfo::Common::output_files_register_closed(
-                  $self->output_files_information(), $frame_file_path);
-    if (!close ($frame_fh)) {
-      $self->document_error($self,
-          sprintf(__("error on closing frame file %s: %s"),
-                                    $frame_outfile, $!));
-      return 0;
-    }
-  } else {
-    $self->document_error($self,
-           sprintf(__("could not open %s for writing: %s"),
-                                  $frame_outfile, $error_message_frame));
-    return 0;
-  }
-  # sequence of bytes
-  my ($toc_frame_path, $toc_frame_path_encoding)
-       = $self->encoded_output_file_name($toc_frame_outfile);
-  my ($toc_frame_fh, $toc_frame_error_message)
-           = Texinfo::Common::output_files_open_out(
-                               $self->output_files_information(), $self,
-                               $toc_frame_path);
-  if (defined($toc_frame_fh)) {
-
-    # this is needed to collect CSS rules.
-    $self->{'current_filename'} = $toc_frame_file;
-    my $shortcontents =
-      &{$self->formatting_function('format_contents')}($self, 'shortcontents');
-    $shortcontents =~ s/\bhref=/target="main" href=/g;
-    my $header = &{$self->formatting_function('format_begin_file')}($self,
-                                                        $toc_frame_file, 
undef);
-    print $toc_frame_fh $header;
-    print $toc_frame_fh '<h2>Content</h2>'."\n";
-    print $toc_frame_fh $shortcontents;
-    print $toc_frame_fh "</body></html>\n";
-
-    $self->{'current_filename'} = undef;
-
-    Texinfo::Common::output_files_register_closed(
-                  $self->output_files_information(), $toc_frame_path);
-    if (!close ($toc_frame_fh)) {
-      $self->document_error($self,
-            sprintf(__("error on closing TOC frame file %s: %s"),
-                                    $toc_frame_outfile, $!));
-      return 0;
-    }
-  } else {
-    $self->document_error($self,
-           sprintf(__("could not open %s for writing: %s"),
-                   $toc_frame_outfile, $toc_frame_error_message));
-    return 0;
-  }
-  return 1;
-}
-
 sub _has_contents_or_shortcontents($)
 {
   my $self = shift;
@@ -11355,14 +11216,10 @@ sub output($$)
            or $self->get_conf('OUTFILE') eq '')) {
     $self->force_conf('SPLIT', '');
     $self->force_conf('MONOLITHIC', 1);
-    $self->force_conf('FRAMES', 0);
   }
   if ($self->get_conf('SPLIT')) {
     $self->set_conf('NODE_FILES', 1);
   }
-  if ($self->get_conf('FRAMES')) {
-    $self->set_conf('shortcontents', 1);
-  }
   $self->set_conf('EXTERNAL_CROSSREF_SPLIT', $self->get_conf('SPLIT'));
 
   if (not defined($self->get_conf('NODE_NAME_IN_INDEX'))) {
@@ -11604,12 +11461,6 @@ sub output($$)
   return undef unless ($init_status < $handler_fatal_error_level
                        and $init_status > -$handler_fatal_error_level);
 
-  if ($self->get_conf('FRAMES')) {
-    my $status = &{$self->formatting_function('format_frame_files')}($self,
-                                                      $destination_directory);
-    return undef if (!$status);
-  }
-
   # determine first file name
   if (!$output_units
       or !defined($output_units->[0]->{'unit_filename'})) {
diff --git a/tp/Texinfo/options_data.txt b/tp/Texinfo/options_data.txt
index a652f388e6..4d84e40b04 100644
--- a/tp/Texinfo/options_data.txt
+++ b/tp/Texinfo/options_data.txt
@@ -232,8 +232,6 @@ EXTERNAL_DIR                       converter_customization 
undef   char *
 EXTRA_HEAD                         converter_customization undef   char *
 FOOTNOTE_END_HEADER_LEVEL          converter_customization undef   int
 FOOTNOTE_SEPARATE_HEADER_LEVEL     converter_customization undef   int
-FRAMES                             converter_customization undef   int
-FRAMESET_DOCTYPE                   converter_customization undef   char *
 HEADER_IN_TABLE                    converter_customization undef   int
 # for ext/highlight_syntax.pm
 HIGHLIGHT_SYNTAX                   converter_customization undef   char *
diff --git a/tp/init/html32.pm b/tp/init/html32.pm
index 641cdeeb51..f26f0045e9 100644
--- a/tp/init/html32.pm
+++ b/tp/init/html32.pm
@@ -44,8 +44,6 @@ texinfo_set_from_init_file('COMPLEX_FORMAT_IN_TABLE', 1);
 
 texinfo_set_from_init_file('DOCTYPE', '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 
3.2//EN" "http://www.w3.org/TR/html32/loose.dtd";>');
 
-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_SHORT_TOC_LINES', '');
diff --git a/tp/t/html_tests.t b/tp/t/html_tests.t
index eac50c2eb4..ad847c5f4c 100644
--- a/tp/t/html_tests.t
+++ b/tp/t/html_tests.t
@@ -1062,14 +1062,13 @@ $check_htmlxref_text
   {'test_file' => 'float_copying.texi',},
   {'SPLIT' => 'chapter', 'footnotestyle' => 'separate'}
 ],
-# FIXME FRAMES are deprecated.
 # FIXME which TEXI2HTML options are really interesting for the test?
 ['sectioning_frames',
   undef,
   # tests for node with directions after section
   {'test_file' => '../../tests/customization/sectioning.texi',
    'CHECK_NORMAL_MENU_STRUCTURE' => 1},
-  {'TEXI2HTML' => 1, 'SPLIT' => 'chapter', 'FRAMES' => 1}
+  {'TEXI2HTML' => 1, 'SPLIT' => 'chapter'}
 ],
 ['test_separated_contents_shortcontents',
 '@contents
diff --git 
a/tp/t/results/html_tests/sectioning_frames/res_html/sectioning_frame.html 
b/tp/t/results/html_tests/sectioning_frames/res_html/sectioning_frame.html
deleted file mode 100644
index 4609546c2a..0000000000
--- a/tp/t/results/html_tests/sectioning_frames/res_html/sectioning_frame.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head><title>Untitled Document</title></head>
-<frameset cols="140,*">
-  <frame name="toc" src="sectioning_toc_frame.html">
-  <frame name="main" src="index.html">
-</frameset>
-</html>
diff --git 
a/tp/t/results/html_tests/sectioning_frames/res_html/sectioning_ovr.html 
b/tp/t/results/html_tests/sectioning_frames/res_html/sectioning_ovr.html
deleted file mode 100644
index e7c3cb6e8a..0000000000
--- a/tp/t/results/html_tests/sectioning_frames/res_html/sectioning_ovr.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!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>Short Table of Contents (Untitled Document)</title>
-
-<meta name="description" content="Short Table of Contents (Untitled Document)">
-<meta name="keywords" content="Short Table of Contents (Untitled Document)">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<meta name="viewport" content="width=device-width,initial-scale=1">
-
-<style type="text/css">
-<!--
-span.program-in-footer {font-size: smaller}
-ul.toc-numbered-mark {list-style: none}
--->
-</style>
-
-
-</head>
-
-<body lang="en">
-<div class="element-shortcontents" id="SEC_Shortcontents">
-<table class="nav-panel" cellpadding="1" cellspacing="1" border="0">
-<tr><td>[<a href="index.html" title="Cover (top) of document">Top</a>]</td>
-<td>[<a href="sectioning_toc.html#SEC_Contents" title="Table of 
contents">Contents</a>]</td>
-<td>[Index]</td>
-<td>[<a href="sectioning_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
-</tr></table>
-<h1 class="shortcontents-heading">Short Table of Contents</h1>
-
-<div class="shortcontents">
-<ul class="toc-numbered-mark">
-<li><a id="stoc-first-node-chapter" href="First-node.html#First-node">1 first 
node chapter</a></li>
-<li><a id="stoc-second-node-chapter" href="Second-node.html">2 second node 
chapter</a></li>
-<li><a id="stoc-unnumbered-chapter" 
href="Third-node-unnumbered.html">unnumbered chapter</a></li>
-</ul>
-</div>
-</div><hr>
-<table class="nav-panel" cellpadding="1" cellspacing="1" border="0">
-<tr><td>[<a href="index.html" title="Cover (top) of document">Top</a>]</td>
-<td>[<a href="sectioning_toc.html#SEC_Contents" title="Table of 
contents">Contents</a>]</td>
-<td>[Index]</td>
-<td>[<a href="sectioning_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
-</tr></table>
-<p>
-  <span class="program-in-footer">This document was generated on <em 
class="emph">a sunny day</em>.</span>
-</p>
-
-
-</body>
-</html>
diff --git 
a/tp/t/results/html_tests/sectioning_frames/res_html/sectioning_toc_frame.html 
b/tp/t/results/html_tests/sectioning_frames/res_html/sectioning_toc_frame.html
deleted file mode 100644
index be29216d81..0000000000
--- 
a/tp/t/results/html_tests/sectioning_frames/res_html/sectioning_toc_frame.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!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>Untitled Document</title>
-
-<meta name="description" content="Untitled Document">
-<meta name="keywords" content="Untitled Document">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<meta name="viewport" content="width=device-width,initial-scale=1">
-
-<style type="text/css">
-<!--
-ul.toc-numbered-mark {list-style: none}
--->
-</style>
-
-
-</head>
-
-<body lang="en">
-<h2>Content</h2>
-<div class="shortcontents">
-<ul class="toc-numbered-mark">
-<li><a id="stoc-first-node-chapter" target="main" 
href="First-node.html#First-node">1 first node chapter</a></li>
-<li><a id="stoc-second-node-chapter" target="main" href="Second-node.html">2 
second node chapter</a></li>
-<li><a id="stoc-unnumbered-chapter" target="main" 
href="Third-node-unnumbered.html">unnumbered chapter</a></li>
-</ul>
-</div>
-</body></html>



reply via email to

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