[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Change in comments, add licence notice to book.pm
From: |
Patrice Dumas |
Subject: |
branch master updated: Change in comments, add licence notice to book.pm. |
Date: |
Fri, 21 Jan 2022 18:08:38 -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 0fb207d6fd Change in comments, add licence notice to book.pm.
0fb207d6fd is described below
commit 0fb207d6fdbef292499bdc1cd2af146d2a420e45
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Jan 22 00:07:30 2022 +0100
Change in comments, add licence notice to book.pm.
HTML.pm: remove unused seenmenus
---
tp/TODO | 7 ++++
tp/Texinfo/Convert/HTML.pm | 82 +++++++++++++++++++++++++++++++++++++++-------
tp/init/book.pm | 24 ++++++++++----
3 files changed, 95 insertions(+), 18 deletions(-)
diff --git a/tp/TODO b/tp/TODO
index 3f5ce2ed55..a76748c367 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -17,6 +17,13 @@ Bugs
====
+HTML API
+========
+
+Add a registering function for:
+%$Texinfo::Config::texinfo_code_types
+Texinfo::Config::commands_translation{$context}->{$command}
+
Profiling
=========
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 52e78f8f86..084eebe483 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -215,6 +215,7 @@ sub html_attribute_class($$;$)
my %css_rules_not_collected = (
);
+# returns an array of CSS element.class seen in the $FILENAME
sub html_get_css_elements_classes($;$)
{
my $self = shift;
@@ -3390,7 +3391,6 @@ sub _convert_heading_command($$$$$)
$result .= $element_header;
-
if ($do_heading) {
if ($self->get_conf('TOC_LINKS')
and $Texinfo::Common::root_commands{$cmdname}
@@ -6229,21 +6229,85 @@ sub _load_htmlxref_files {
}
# converter state
+#
+# output_init_conf
+#
+# document_name
+# destination_directory
+#
# css_map
-# targets for directions. Keys are elements references, values are
-# target information hash references described above before
-# the API functions used to access those informations.
# htmlxref
-# out_filepaths
-# file_counters
# paragraph_symbol
# line_break_element
+# non_breaking_space
# options_latex_math
#
# simpletitle_tree
# simpletitle_command_name
+# title_string
+# title_tree
+# documentdescription_string
+# copying_comment
+#
+# css_import_lines
+# css_rule_lines
+# index_entries_by_letter
+# index_names
+# index_entries
+# htmlxref_files
+# htmlxref
+# check_htmlxref_already_warned
#
+# commands_args (though it does not seems to be dynamic.
+# FIXME: always point to default?)
+# default_formatting_functions
+#
# commands_conversion
+# commands_open
+# types_conversion
+# types_open
+# no_arg_commands_formatting
+# style_commands_formatting
+# code_types
+# commands_translation
+#
+# document_context
+# multiple_pass
+# pending_closes
+# ignore_notice
+# pending_inline_content
+# associated_inline_content
+#
+#
+# targets for directions. Keys are elements references, values are
+# target information hash references described above before
+# the API functions used to access those informations.
+# tree_units
+# labels
+# out_filepaths
+# counter_in_file
+# elements_in_file_count # the number of tree unit elements in file
+# file_counters # begin at elements_in_file_count decrease
+# # each time the tree unit element is closed
+# current_filename
+# current_root_element
+# seen_ids
+#
+# jslicenses_infojs
+# jslicenses_math
+# jslicenses
+#
+# special_elements_targets
+# special_elements_directions
+# global_target_elements_directions
+#
+# document_global_context_css
+# file_css
+#
+# file_informations
+#
+# explained_commands # not defined in the converter per se but in an
+# # @-command conversion function and only used
there
my %special_characters = (
'paragraph_symbol' => ['¶', '00B6'],
@@ -6450,6 +6514,7 @@ sub converter_initialize($)
if (exists
($Texinfo::Config::commands_translation{$context}->{$command})) {
$self->{'commands_translation'}->{$context}->{$command}
= $Texinfo::Config::commands_translation{$context}->{$command};
+ # FIXME check that the modification is to a copy and not the default
config
delete $self->{'translated_commands'}->{$command};
# note that %default_commands_translation is empty for now
} elsif (defined($default_commands_translation{$context}->{$command})) {
@@ -9357,9 +9422,7 @@ sub _convert($$;$)
}
} elsif ($arg_type eq 'monospace') {
push @{$self->{'document_context'}->[-1]->{'monospace'}}, 1;
- #$self->{'document_context'}->[-1]->{'code'}++;
$arg_formatted->{$arg_type} = $self->_convert($arg,
$explanation);
- #$self->{'document_context'}->[-1]->{'code'}--;
pop @{$self->{'document_context'}->[-1]->{'monospace'}};
} elsif ($arg_type eq 'string') {
$self->_new_document_context($command_type);
@@ -9424,9 +9487,6 @@ sub _convert($$;$)
if ($element->{'cmdname'} eq 'node') {
$self->{'current_node'} = $element;
}
- elsif ($element->{'cmdname'} eq 'menu' and $self->{'current_node'}) {
- $self->{'seenmenus'}->{$self->{'current_node'}} = 1;
- }
# args are formatted, now format the command itself
if ($args_formatted) {
if (!defined($self->{'commands_conversion'}->{$command_name})) {
diff --git a/tp/init/book.pm b/tp/init/book.pm
index c818ef21d9..3dd0ea6c66 100644
--- a/tp/init/book.pm
+++ b/tp/init/book.pm
@@ -1,10 +1,21 @@
# A style that tries to be analogous with a book, in HTML.
#
-# This file is in the public domain. Thus it may easily be used as an
-# example for further customizations.
+# Copyright 2004-2021 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License,
+# or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Originally written by Patrice Dumas in 2004.
-# Modified in 2007, 2008.
#
# This style is based on the scriptbasic style.
@@ -44,9 +55,6 @@ texinfo_set_from_init_file('BIG_RULE', '<hr>');
my $toc_numbered_mark_class = 'toc-numbered-mark';
-#texinfo_set_from_init_file('DOCTYPE',
-# '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">');
-
my ($book_previous_default_filename, $book_previous_file_name,
$book_unumbered_nr);
@@ -78,7 +86,6 @@ sub book_print_up_toc($$)
}
# this happens for example for top tree unit
return '' if !(@up_commands);
- #print $fh "<ul>" . &$anchor('', $Texi2HTML::HREF{Contents}, '[' .
$Texi2HTML::NAME{Contents} . ']') . " <br>\n";
my $up = shift @up_commands;
#print STDERR "$up
".Texinfo::Convert::Texinfo::root_element_command_to_texinfo($up)."\n";
$result .= $converter->html_attribute_class('ul',
[$toc_numbered_mark_class])."><li>"
@@ -155,6 +162,9 @@ sub book_print_sub_toc($$$)
return $result;
}
+# this function is very similar with the default function, but there is
+# an additional sub toc before the content. It should be synced with
+# the default function.
sub book_convert_heading_command($$$$$)
{
my $self = shift;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Change in comments, add licence notice to book.pm.,
Patrice Dumas <=