[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * Texinfo/Convert/HTML.pm (_convert_def_line_type
From: |
Gavin D. Smith |
Subject: |
branch master updated: * Texinfo/Convert/HTML.pm (_convert_def_line_type) <DEF_TABLE>: Reorder conditional and remove one level of indentation. No functional changes. |
Date: |
Sat, 18 Feb 2023 09:22:01 -0500 |
This is an automated email from the git hooks/post-receive script.
gavin pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 299e34092b * Texinfo/Convert/HTML.pm (_convert_def_line_type)
<DEF_TABLE>: Reorder conditional and remove one level of indentation. No
functional changes.
299e34092b is described below
commit 299e34092b692abfab663d01c6fff90a0e063871
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Feb 18 14:20:33 2023 +0000
* Texinfo/Convert/HTML.pm (_convert_def_line_type) <DEF_TABLE>:
Reorder conditional and remove one level of indentation. No
functional changes.
---
ChangeLog | 6 +++
tp/Texinfo/Convert/HTML.pm | 122 ++++++++++++++++++++++-----------------------
2 files changed, 67 insertions(+), 61 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 26439c36c0..b6f3b6dccc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-02-18 Gavin Smith <gavinsmith0123@gmail.com>
+
+ * Texinfo/Convert/HTML.pm (_convert_def_line_type) <DEF_TABLE>:
+ Reorder conditional and remove one level of indentation. No
+ functional changes.
+
2023-02-18 Gavin Smith <gavinsmith0123@gmail.com>
* Texinfo/Convert/TexinfoMarkup.pm (%defcommand_name_type):
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 6a97012611..1acbc61b07 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -6796,70 +6796,10 @@ sub _convert_def_line_type($$$$)
my $def_call = '';
$def_call .= $result_type . ' ' if ($result_type ne '');
-
$def_call .= $result_name;
-
$def_call .= $def_space . $result_arguments if ($result_arguments ne '');
- if (!$self->get_conf('DEF_TABLE')) {
- my $category;
- if ($element->{'extra'} and $element->{'extra'}->{'def_parsed_hash'}
- and defined($element->{'extra'}->{'def_parsed_hash'}->{'category'})) {
- $category = $element->{'extra'}->{'def_parsed_hash'}->{'category'};
- }
- my $category_result = '';
- my $category_tree;
- if (defined($category) and $category ne '') {
- if ($element->{'extra'}->{'def_parsed_hash'}->{'class'}) {
- if ($command_name eq 'deftypeop'
- and $element->{'extra'}->{'def_parsed_hash'}->{'type'}
- and $self->get_conf('deftypefnnewline') eq 'on') {
- $category_tree = $self->gdt('{category} on @code{{class}}:@* ',
- {'category' => $category,
- 'class' =>
$element->{'extra'}->{'def_parsed_hash'}->{'class'}});
- } elsif ($command_name eq 'defop' or $command_name eq 'deftypeop') {
- $category_tree = $self->gdt('{category} on @code{{class}}: ',
- {'category' => $category,
- 'class' =>
$element->{'extra'}->{'def_parsed_hash'}->{'class'}});
- } elsif ($command_name eq 'defcv' or $command_name eq 'deftypecv') {
- $category_tree = $self->gdt('{category} of @code{{class}}: ',
- {'category' => $category,
- 'class' =>
$element->{'extra'}->{'def_parsed_hash'}->{'class'}});
- }
- } elsif ($element->{'extra'}->{'def_parsed_hash'}->{'type'}
- and ($command_name eq 'deftypefn' or $command_name eq
'deftypeop')
- and $self->get_conf('deftypefnnewline') eq 'on') {
- # FIXME if in @def* in @example and with @deftypefnnewline on
- # there is no effect of @deftypefnnewline on, as @* in preformatted
- # environment becomes an end of line, but the def* line is not in a
preformatted
- # environment. There should be an explicit <br> in that case.
Probably
- # requires changing the conversion of @* in a @def* line in
preformatted,
- # nothing really specific of @deftypefnnewline on.
- $category_tree = $self->gdt('{category}:@* ', {'category' =>
$category});
- } else {
- $category_tree = $self->gdt('{category}: ', {'category' => $category});
- }
- $category_result = $self->convert_tree($category_tree);
- }
-
- if ($category_result ne '') {
- my $open = $self->html_attribute_class('span', ['category-def']);
- if ($open ne '') {
- $category_result = $open.'>'.$category_result.'</span>';
- }
- }
- my $anchor_span_open = '';
- my $anchor_span_close = '';
- my $anchor = $self->_get_copiable_anchor($index_id);
- if ($anchor ne '') {
- $anchor_span_open = '<span>';
- $anchor_span_close = '</span>';
- }
- return $self->html_attribute_class('dt', \@classes)
- . "$index_label>" . $category_result . $anchor_span_open
- . $def_call
- . "$anchor$anchor_span_close</dt>\n";
- } else {
+ if ($self->get_conf('DEF_TABLE')) {
my $category_result = '';
my $definition_category_tree
= Texinfo::Convert::Utils::definition_category_tree($self, $element);
@@ -6872,6 +6812,66 @@ sub _convert_def_line_type($$$$)
. $def_call . '</td>'.$self->html_attribute_class('td', ['category-def'])
. '>' . '[' . $category_result . ']' . "</td></tr>\n";
}
+
+ my $category;
+ if ($element->{'extra'} and $element->{'extra'}->{'def_parsed_hash'}
+ and defined($element->{'extra'}->{'def_parsed_hash'}->{'category'})) {
+ $category = $element->{'extra'}->{'def_parsed_hash'}->{'category'};
+ }
+ my $category_result = '';
+ my $category_tree;
+ if (defined($category) and $category ne '') {
+ if ($element->{'extra'}->{'def_parsed_hash'}->{'class'}) {
+ if ($command_name eq 'deftypeop'
+ and $element->{'extra'}->{'def_parsed_hash'}->{'type'}
+ and $self->get_conf('deftypefnnewline') eq 'on') {
+ $category_tree = $self->gdt('{category} on @code{{class}}:@* ',
+ {'category' => $category,
+ 'class' => $element->{'extra'}->{'def_parsed_hash'}->{'class'}});
+ } elsif ($command_name eq 'defop' or $command_name eq 'deftypeop') {
+ $category_tree = $self->gdt('{category} on @code{{class}}: ',
+ {'category' => $category,
+ 'class' => $element->{'extra'}->{'def_parsed_hash'}->{'class'}});
+ } elsif ($command_name eq 'defcv' or $command_name eq 'deftypecv') {
+ $category_tree = $self->gdt('{category} of @code{{class}}: ',
+ {'category' => $category,
+ 'class' => $element->{'extra'}->{'def_parsed_hash'}->{'class'}});
+ }
+ } elsif ($element->{'extra'}->{'def_parsed_hash'}->{'type'}
+ and ($command_name eq 'deftypefn' or $command_name eq 'deftypeop')
+ and $self->get_conf('deftypefnnewline') eq 'on') {
+ # FIXME if in @def* in @example and with @deftypefnnewline
+ # on there is no effect of @deftypefnnewline on, as @* in
+ # preformatted environment becomes an end of line, but the def*
+ # line is not in a preformatted environment. There should be
+ # an explicit <br> in that case. Probably requires changing
+ # the conversion of @* in a @def* line in preformatted, nothing
+ # really specific of @deftypefnnewline on.
+ $category_tree = $self->gdt('{category}:@* ',
+ {'category' => $category});
+ } else {
+ $category_tree = $self->gdt('{category}: ', {'category' => $category});
+ }
+ $category_result = $self->convert_tree($category_tree);
+ }
+
+ if ($category_result ne '') {
+ my $open = $self->html_attribute_class('span', ['category-def']);
+ if ($open ne '') {
+ $category_result = $open.'>'.$category_result.'</span>';
+ }
+ }
+ my $anchor_span_open = '';
+ my $anchor_span_close = '';
+ my $anchor = $self->_get_copiable_anchor($index_id);
+ if ($anchor ne '') {
+ $anchor_span_open = '<span>';
+ $anchor_span_close = '</span>';
+ }
+ return $self->html_attribute_class('dt', \@classes)
+ . "$index_label>" . $category_result . $anchor_span_open
+ . $def_call
+ . "$anchor$anchor_span_close</dt>\n";
}
sub _get_copiable_anchor {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * Texinfo/Convert/HTML.pm (_convert_def_line_type) <DEF_TABLE>: Reorder conditional and remove one level of indentation. No functional changes.,
Gavin D. Smith <=