[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/init/highlight_syntax.pm (highlight_open_inl
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/init/highlight_syntax.pm (highlight_open_inline_container_type) (highlight_preformatted_command): update to match with changes in HTML output. |
Date: |
Fri, 21 Jan 2022 10:42: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 7f90c6af89 * tp/init/highlight_syntax.pm
(highlight_open_inline_container_type) (highlight_preformatted_command): update
to match with changes in HTML output.
7f90c6af89 is described below
commit 7f90c6af89a928624d31211a6d34ba86f75c8a3b
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Jan 21 16:42:01 2022 +0100
* tp/init/highlight_syntax.pm (highlight_open_inline_container_type)
(highlight_preformatted_command): update to match with changes in
HTML output.
* tests: add other tests requiring other softwares.
* tp/init/highlight_syntax.pm (highlight_process): avoid version in output
in tests.
---
ChangeLog | 10 +
tp/Texinfo/Convert/HTML.pm | 1 -
tp/init/highlight_syntax.pm | 78 ++++++--
tp/maintain/regenerate_cmd_tests.sh | 12 +-
tp/tests/Makefile.am | 24 ++-
tp/tests/other/Makefile.am | 11 ++
tp/tests/other/highlight_example.texi | 37 ++++
tp/tests/other/list-of-tests | 1 +
.../highlight_syntax_example/highlight_example.1 | 0
.../highlight_syntax_example/highlight_example.2 | 0
.../highlight_example.html | 203 +++++++++++++++++++++
.../highlight_example_highlight_C_input.C | 12 ++
.../highlight_example_highlight_C_output.html | 15 ++
.../highlight_example_highlight_perl_input.perl | 9 +
.../highlight_example_highlight_perl_output.html | 12 ++
.../highlight_example_highlight_texinfo_input.texi | 6 +
...highlight_example_highlight_texinfo_output.html | 9 +
.../test_scripts/other_highlight_syntax_example.sh | 25 +++
18 files changed, 435 insertions(+), 30 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index aa34d0e6c5..53ea3899cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-01-21 Patrice Dumas <pertusus@free.fr>
+
+ * tp/init/highlight_syntax.pm (highlight_open_inline_container_type)
+ (highlight_preformatted_command): update to match with changes in
+ HTML output.
+
+ * tests: add other tests requiring other softwares.
+
+ * tp/init/highlight_syntax.pm (highlight_process): avoid version in
output in tests.
+
2022-01-21 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/HTML.pm (html_attribute_class),
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 9b2f5d56dd..52e78f8f86 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -9397,7 +9397,6 @@ sub _convert($$;$)
if ($code_style_commands{$command_name}
or $preformatted_code_commands{$command_name}
or $regular_font_style_commands{$command_name}) {
- #$self->{'document_context'}->[-1]->{'code'}--;
pop @{$self->{'document_context'}->[-1]->{'monospace'}};
} elsif ($upper_case_commands{$command_name}) {
$self->{'document_context'}->[-1]->{'formatting_context'}->[-1]->{'upper_case'}--;
diff --git a/tp/init/highlight_syntax.pm b/tp/init/highlight_syntax.pm
index f8a1336bf6..c95912d26f 100644
--- a/tp/init/highlight_syntax.pm
+++ b/tp/init/highlight_syntax.pm
@@ -39,6 +39,26 @@ texinfo_register_handler('structure', \&highlight_process);
texinfo_register_command_formatting('example',
\&highlight_preformatted_command);
+# normally this is done in preformatted type, but preformatted
+# types in example are ignored, register inline pending content
+# when opening an example block
+texinfo_register_command_opening('example',
\&highlight_open_inline_container_type);
+
+sub highlight_open_inline_container_type($$$)
+{
+ my $self = shift;
+ my $cmdname = shift;
+ my $command = shift;
+
+ my $pending_formatted = $self->get_pending_formatted_inline_content();
+
+ if (defined($pending_formatted)) {
+ $self->associate_pending_formatted_inline_content($command,
$pending_formatted);
+ }
+ return '';
+}
+
+
# the end of a string were randomly generated once for all.
my $range_separator = '_______________________________________ highlight
texinfo _GT Haib0aik zei4YieH';
@@ -137,7 +157,7 @@ sub highlight_process($$)
if (defined($language)) {
if (not exists($languages{$language})) {
$languages{$language} = {
- 'counter' => 0.,
+ 'counter' => 0,
};
}
$languages{$language}->{'counter'}++;
@@ -208,13 +228,15 @@ sub highlight_process($$)
close(HIGHLIGHT_LANG_IN);
# call source highlighting program
+ my $version_option='';
+ $version_option='--gen-version ' if ($self->get_conf('TEST'));
my $html_result_file = $languages{$language}->{'r_html_file'};
my @option_line_ranges = ();
foreach my $line_range (@{$languages{$language}->{'line_ranges'}}) {
push @option_line_ranges, '"'.$line_range->[0].'-'.$line_range->[1].'"';
}
my $option_line_range_str = join(',', @option_line_ranges);
- my $cmd = "source-highlight --src-lang=$language --out-format=html5 -i
'$rfile' -o '$html_result_file' --line-range=$option_line_range_str
--range-separator='$range_separator'";
+ my $cmd = "source-highlight ${version_option}--src-lang=$language
--out-format=html5 -i '$rfile' -o '$html_result_file'
--line-range=$option_line_range_str --range-separator='$range_separator'";
if (system($cmd)) {
$self->document_error($self,
@@ -307,36 +329,52 @@ sub highlight_preformatted_command($$)
# type formatting, from _convert_preformatted_type() and
_preformatted_class()
my $pre_class;
my @pre_classes = $self->preformatted_classes_stack();
+ # since we are formatting @example itself, it is not in the preformatted
+ # context anymore, so we readd.
+ # FIXME should be $pre_class_commands{$cmdname}, which is set using
+ # %small_alias. Both are private.
+ push @pre_classes, $cmdname;
foreach my $class (@pre_classes) {
- # FIXME maybe add or $pre_class eq 'menu-preformatted' to override
- # 'menu-preformatted' with 'menu-comment'?
+ # FIXME maybe add or $pre_class eq 'menu' to override
+ # 'menu' with 'menu-comment'?
$pre_class = $class unless ($pre_class
- and
$Texinfo::Common::preformatted_code_commands{$pre_class}
- and
!($Texinfo::Common::preformatted_code_commands{$class}
- or $class eq 'menu-preformatted'));
+ and $Texinfo::Common::preformatted_code_commands{$pre_class}
+ and !($Texinfo::Common::preformatted_code_commands{$class}
+ or $class eq 'menu'));
}
+ $pre_class = $pre_class.'-preformatted';
-
+ # TODO if needed, aliasing small variants could be done
+ # with the difficulty that the %small_alias hash is private
+ my $main_cmdname = $cmdname;
# FIXME not clear on that. What to do with @example arguments?
- my $extra_classes;
- if ($cmdname eq 'example' and $command->{'args'}) {
- $extra_classes = [];
- for my $example_arg (@{$command->{'args'}}) {
- # convert or remove all @-commands, using simple ascii and unicode
- # characters
- my $converted_arg =
Texinfo::Convert::NodeNameNormalization::convert($example_arg);
- if ($converted_arg ne '') {
- push @$extra_classes, $converted_arg;
+ my @classes;
+ if ($cmdname eq 'example') {
+ if ($command->{'args'}) {
+ for my $example_arg (@{$command->{'args'}}) {
+ # convert or remove all @-commands, using simple ascii and unicode
+ # characters
+ my $converted_arg =
Texinfo::Convert::NodeNameNormalization::convert($example_arg);
+ if ($converted_arg ne '') {
+ push @classes, $converted_arg;
+ }
}
}
+ } elsif ($main_cmdname eq 'lisp') {
+ push @classes, $main_cmdname;
+ $main_cmdname = 'example';
}
+ unshift @classes, $main_cmdname;
my $result_content = $commands{$cmdname}->{'results'}->{$command};
-
+ # do it here, it is not done in preformatted. It was correctly
registered
+ # through highlight_open_inline_container_type.
+ $result_content =
$self->get_associated_formatted_inline_content($command)
+ . $result_content;
$result_content =~ s/^\n/\n\n/; # a newline immediately after a <pre> is
ignored.
my $preformatted_result_content = $self->html_attribute_class('pre',
-
$pre_class).">".$result_content."</pre>";
- return $self->html_attribute_class('div', $cmdname, $extra_classes).">\n"
+
[$pre_class]).">".$result_content."</pre>";
+ return $self->html_attribute_class('div', \@classes).">\n"
.$preformatted_result_content.'</div>'."\n";
}
} elsif (defined($language)) {
diff --git a/tp/maintain/regenerate_cmd_tests.sh
b/tp/maintain/regenerate_cmd_tests.sh
index 5b899441bd..83aa0df717 100755
--- a/tp/maintain/regenerate_cmd_tests.sh
+++ b/tp/maintain/regenerate_cmd_tests.sh
@@ -31,11 +31,13 @@ shift
destdir=$1
shift
-while test z"$1" = 'z-base' -o z"$1" = 'z-tex_html'; do
+while test z"$1" = 'z-base' -o z"$1" = 'z-tex_html' -o z"$1" = 'z-other' ; do
if test z"$1" = 'z-base'; then
base_test_dirs=$2
elif test z"$1" = 'z-tex_html'; then
tex_html_test_dirs=$2
+ elif test z"$1" = 'z-other' ; then
+ other_test_dirs=$2
else
echo "$0: Bad args" 1>&2
exit 1
@@ -97,6 +99,13 @@ if test "z$TEX_HTML_TESTS" != z"yes"; then
echo "Skipping HTML TeX tests that are not easily reproducible"
exit 77
fi
+' >> $one_test_file
+ elif test $type = 'other'; then
+ echo '
+if test "z$OTHER_TESTS" != z"yes"; then
+ echo "Skipping other tests that are not easily reproducible"
+ exit 77
+fi
' >> $one_test_file
fi
@@ -136,6 +145,7 @@ END_HEADER
gather_tests base "$base_test_dirs"
gather_tests tex_html "$tex_html_test_dirs"
+gather_tests other "$other_test_dirs"
echo "$test_driving_files
" >> $outfile
diff --git a/tp/tests/Makefile.am b/tp/tests/Makefile.am
index 2783f85f31..1e88614d50 100644
--- a/tp/tests/Makefile.am
+++ b/tp/tests/Makefile.am
@@ -17,25 +17,30 @@ $(srcdir)/Makefile.onetst: \
../maintain/regenerate_cmd_tests.sh $(test_driving_files_generated_list)
cd $(srcdir) \
&& $(SHELL) ../maintain/regenerate_cmd_tests.sh Makefile.onetst . \
- -base '$(base_tests)' \
- -tex_html '$(tex_html_tests)'
+ -base '$(base_tests_dirs)' \
+ -tex_html '$(tex_html_tests_dirs)' \
+ -other '$(other_tests_dirs)'
-base_tests = formatting sectioning indices nested_formats contents layout
-tex_html_tests = tex_html
+base_tests_dirs = formatting sectioning indices nested_formats contents layout
+tex_html_tests_dirs = tex_html
+other_tests_dirs = other
-DIST_SUBDIRS = many_input_files $(base_tests) $(tex_html_tests)
+DIST_SUBDIRS = many_input_files $(base_tests_dirs) $(tex_html_tests_dirs)
$(other_tests_dirs)
SUBDIRS = . many_input_files
copy-tests:
- $(srcdir)/parser_tests.sh -copy $(base_tests)
+ $(srcdir)/parser_tests.sh -copy $(base_tests_dirs)
cd many_input_files && $(MAKE) copy-tests
copy-tex-html:
- $(srcdir)/parser_tests.sh -copy $(tex_html_tests)
+ $(srcdir)/parser_tests.sh -copy $(tex_html_tests_dirs)
cd many_input_files && $(MAKE) copy-tex-html
+copy-other-tests:
+ $(srcdir)/parser_tests.sh -copy $(other_tests_dirs)
+
clean-tests:
- $(srcdir)/parser_tests.sh -clean $(base_tests) $(tex_html_tests)
+ $(srcdir)/parser_tests.sh -clean $(base_tests_dirs)
$(tex_html_tests_dirs)
TESTS = $(one_test_files_generated_list)
@@ -47,6 +52,9 @@ all-checks all-check: all
tex-html-checks tex-html-check: all
$(MAKE) $(AM_MAKEFLAGS) check TEX_HTML_TESTS=yes
+other-checks: all
+ $(MAKE) $(AM_MAKEFLAGS) check OTHER_TESTS=yes
+
EXTRA_DIST = run_parser_all.sh parser_tests.sh \
$(one_test_files_generated_list) coverage_macro.texi
diff --git a/tp/tests/other/Makefile.am b/tp/tests/other/Makefile.am
new file mode 100644
index 0000000000..afb0927cf2
--- /dev/null
+++ b/tp/tests/other/Makefile.am
@@ -0,0 +1,11 @@
+EXTRA_DIST = \
+ highlight_example.texi \
+ list-of-tests res_parser
+
+DISTCLEANFILES = tests.log tests.out
+
+distclean-local:
+ rm -rf out_parser raw_out_parser diffs test_log
+
+dist-hook:
+ rm -rf `find $(distdir)/res_parser -name .git`
diff --git a/tp/tests/other/highlight_example.texi
b/tp/tests/other/highlight_example.texi
new file mode 100644
index 0000000000..4446fd5fae
--- /dev/null
+++ b/tp/tests/other/highlight_example.texi
@@ -0,0 +1,37 @@
+\input texinfo @c -*-texinfo-*-
+@setfilename highlight_example.info
+
+@node Top
+@top top
+
+@node chapter
+@chapter chap
+
+Texinfo
+@example texinfo
+@code{texinfo}
+@@code@{protected@}
+@end example
+
+C++
+@example C++
+// Your First C++ Program
+
+#include <iostream>
+
+int main() @{
+ std::cout << "Hello World!";
+ return 0;
+@}
+@end example
+
+perl
+@example perl
+my $list = ['a', 'b'];
+sub do ($) @{
+ my $arg = shift;
+ return $arg + 4;
+@}
+@end example
+
+@bye
diff --git a/tp/tests/other/list-of-tests b/tp/tests/other/list-of-tests
new file mode 100644
index 0000000000..2ee38bee89
--- /dev/null
+++ b/tp/tests/other/list-of-tests
@@ -0,0 +1 @@
+highlight_syntax_example highlight_example.texi --html
--init=highlight_syntax.pm
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example/highlight_example.1
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example.1
new file mode 100644
index 0000000000..e69de29bb2
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example/highlight_example.2
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example.2
new file mode 100644
index 0000000000..e69de29bb2
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example/highlight_example.html
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example.html
new file mode 100644
index 0000000000..e2e5a5e740
--- /dev/null
+++ b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example.html
@@ -0,0 +1,203 @@
+<!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="top">
+<meta name="keywords" content="top">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="Generator" content="texi2any">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<style type="text/css">
+<!--
+div.example {margin-left: 3.2em}
+span.program-in-footer {font-size: smaller}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+
+<div class="top-level-extent" id="Top">
+<table class="nav-panel" cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[ < ]</td>
+<td valign="middle" align="left">[<a href="#chapter" title="Next section in
reading order"> > </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[Contents]</td>
+<td valign="middle" align="left">[Index]</td>
+<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ?
</a>]</td>
+</tr></table>
+<h1 class="top" id="top">top</h1>
+
+<hr style="height: 6px;">
+<div class="chapter-level-extent" id="chapter">
+<table class="nav-panel" cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[<a href="#Top" title="Beginning of this
chapter or previous chapter"> << </a>]</td>
+<td valign="middle" align="left">[<a href="#Top" title="Previous section in
reading order"> < </a>]</td>
+<td valign="middle" align="left">[<a href="#Top" title="Up section"> Up
</a>]</td>
+<td valign="middle" align="left">[ > ]</td>
+<td valign="middle" align="left">[ >> ]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of
document">Top</a>]</td>
+<td valign="middle" align="left">[Contents]</td>
+<td valign="middle" align="left">[Index]</td>
+<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ?
</a>]</td>
+</tr></table>
+<h1 class="chapter" id="chap">1 chap</h1>
+
+<p>Texinfo
+</p><div class="example texinfo">
+<pre class="example-preformatted">texinfo
+<i><span style="color:#9A1900">@code{protected}</span></i>
+</pre></div>
+
+<p>C++
+</p><div class="example C++">
+<pre class="example-preformatted"><i><span style="color:#9A1900">// Your First
C++ Program</span></i>
+
+<b><span style="color:#000080">#include</span></b> <span
style="color:#FF0000"><iostream></span>
+
+<span style="color:#009900">int</span> <b><span
style="color:#000000">main</span></b><span style="color:#990000">()</span>
<span style="color:#FF0000">{</span>
+ std<span style="color:#990000">::</span>cout <span
style="color:#990000"><<</span> <span style="color:#FF0000">"Hello
World!"</span><span style="color:#990000">;</span>
+ <b><span style="color:#0000FF">return</span></b> <span
style="color:#993399">0</span><span style="color:#990000">;</span>
+<span style="color:#FF0000">}</span>
+</pre></div>
+
+<p>perl
+</p><div class="example perl">
+<pre class="example-preformatted"><b><span style="color:#0000FF">my</span></b>
<span style="color:#009900">$list</span> <span style="color:#990000">=</span>
<span style="color:#990000">[</span><span style="color:#FF0000">'a'</span><span
style="color:#990000">,</span> <span style="color:#FF0000">'b'</span><span
style="color:#990000">];</span>
+<b><span style="color:#0000FF">sub</span></b> <b><span
style="color:#0000FF">do</span></b> <span style="color:#990000">(</span>$<span
style="color:#990000">)</span> <span style="color:#FF0000">{</span>
+ <b><span style="color:#0000FF">my</span></b> <span
style="color:#009900">$arg</span> <span style="color:#990000">=</span> <b><span
style="color:#0000FF">shift</span></b><span style="color:#990000">;</span>
+ <b><span style="color:#0000FF">return</span></b> <span
style="color:#009900">$arg</span> <span style="color:#990000">+</span> <span
style="color:#993399">4</span><span style="color:#990000">;</span>
+<span style="color:#FF0000">}</span>
+</pre></div>
+
+<hr style="height: 6px;">
+</div>
+</div>
+<div class="element-about" id="SEC_About">
+<table class="nav-panel" cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[<a href="#Top" title="Cover (top) of
document">Top</a>]</td>
+<td valign="middle" align="left">[Contents]</td>
+<td valign="middle" align="left">[Index]</td>
+<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ?
</a>]</td>
+</tr></table>
+<h1 class="about-heading">About This Document</h1>
+
+<p>
+ This document was generated on <em class="emph">a sunny day</em> using <a
class="uref" href="http://www.gnu.org/software/texinfo/"><em
class="emph">texi2any</em></a>.
+</p>
+<p>
+ The buttons in the navigation panels have the following meaning:
+</p>
+<table border="1">
+ <tr>
+ <th> Button </th>
+ <th> Name </th>
+ <th> Go to </th>
+ <th> From 1.2.3 go to</th>
+ </tr>
+ <tr>
+ <td align="center"> [ << ] </td>
+ <td align="center">FastBack</td>
+ <td>Beginning of this chapter or previous chapter</td>
+ <td>1</td>
+ </tr>
+ <tr>
+ <td align="center"> [ < ] </td>
+ <td align="center">Back</td>
+ <td>Previous section in reading order</td>
+ <td>1.2.2</td>
+ </tr>
+ <tr>
+ <td align="center"> [ Up ] </td>
+ <td align="center">Up</td>
+ <td>Up section</td>
+ <td>1.2</td>
+ </tr>
+ <tr>
+ <td align="center"> [ > ] </td>
+ <td align="center">Forward</td>
+ <td>Next section in reading order</td>
+ <td>1.2.4</td>
+ </tr>
+ <tr>
+ <td align="center"> [ >> ] </td>
+ <td align="center">FastForward</td>
+ <td>Next chapter</td>
+ <td>2</td>
+ </tr>
+ <tr>
+ <td align="center"> [Top] </td>
+ <td align="center">Top</td>
+ <td>Cover (top) of document</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td align="center"> [Contents] </td>
+ <td align="center">Contents</td>
+ <td>Table of contents</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td align="center"> [Index] </td>
+ <td align="center">Index</td>
+ <td>Index</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td align="center"> [ ? ] </td>
+ <td align="center">About</td>
+ <td>About (help)</td>
+ <td> </td>
+ </tr>
+</table>
+
+<p>
+ where the <strong class="strong"> Example </strong> assumes that the current
position is at <strong class="strong"> Subsubsection One-Two-Three </strong> of
a document of the following structure:
+</p>
+
+<ul>
+ <li> 1. Section One
+ <ul>
+ <li>1.1 Subsection One-One
+ <ul>
+ <li>...</li>
+ </ul>
+ </li>
+ <li>1.2 Subsection One-Two
+ <ul>
+ <li>1.2.1 Subsubsection One-Two-One</li>
+ <li>1.2.2 Subsubsection One-Two-Two</li>
+ <li>1.2.3 Subsubsection One-Two-Three
+ <strong><== Current Position </strong></li>
+ <li>1.2.4 Subsubsection One-Two-Four</li>
+ </ul>
+ </li>
+ <li>1.3 Subsection One-Three
+ <ul>
+ <li>...</li>
+ </ul>
+ </li>
+ <li>1.4 Subsection One-Four</li>
+ </ul>
+ </li>
+</ul>
+
+</div><hr>
+<p>
+ <span class="program-in-footer">This document was generated on <em
class="emph">a sunny day</em> using <a class="uref"
href="http://www.gnu.org/software/texinfo/"><em
class="emph">texi2any</em></a>.</span>
+</p>
+
+
+</body>
+</html>
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_C_input.C
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_C_input.C
new file mode 100644
index 0000000000..490017942f
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_C_input.C
@@ -0,0 +1,12 @@
+Automatically generated
+
+_______________________ 0
+// Your First C++ Program
+
+#include <iostream>
+
+int main() {
+ std::cout << "Hello World!";
+ return 0;
+}
+_______________________ 0
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_C_output.html
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_C_output.html
new file mode 100644
index 0000000000..e6bf5a1ecd
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_C_output.html
@@ -0,0 +1,15 @@
+<!-- Generator: GNU source-highlight
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>_______________________________________ highlight texinfo _GT Haib0aik
zei4YieH
+<i><span style="color:#9A1900">// Your First C++ Program</span></i>
+
+<b><span style="color:#000080">#include</span></b> <span
style="color:#FF0000"><iostream></span>
+
+<span style="color:#009900">int</span> <b><span
style="color:#000000">main</span></b><span style="color:#990000">()</span>
<span style="color:#FF0000">{</span>
+ std<span style="color:#990000">::</span>cout <span
style="color:#990000"><<</span> <span style="color:#FF0000">"Hello
World!"</span><span style="color:#990000">;</span>
+ <b><span style="color:#0000FF">return</span></b> <span
style="color:#993399">0</span><span style="color:#990000">;</span>
+<span style="color:#FF0000">}</span>
+_______________________________________ highlight texinfo _GT Haib0aik zei4YieH
+</pre>
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_perl_input.perl
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_perl_input.perl
new file mode 100644
index 0000000000..5cd9149b62
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_perl_input.perl
@@ -0,0 +1,9 @@
+Automatically generated
+
+_______________________ 0
+my $list = ['a', 'b'];
+sub do ($) {
+ my $arg = shift;
+ return $arg + 4;
+}
+_______________________ 0
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_perl_output.html
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_perl_output.html
new file mode 100644
index 0000000000..ca9b03a54f
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_perl_output.html
@@ -0,0 +1,12 @@
+<!-- Generator: GNU source-highlight
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>_______________________________________ highlight texinfo _GT Haib0aik
zei4YieH
+<b><span style="color:#0000FF">my</span></b> <span
style="color:#009900">$list</span> <span style="color:#990000">=</span> <span
style="color:#990000">[</span><span style="color:#FF0000">'a'</span><span
style="color:#990000">,</span> <span style="color:#FF0000">'b'</span><span
style="color:#990000">];</span>
+<b><span style="color:#0000FF">sub</span></b> <b><span
style="color:#0000FF">do</span></b> <span style="color:#990000">(</span>$<span
style="color:#990000">)</span> <span style="color:#FF0000">{</span>
+ <b><span style="color:#0000FF">my</span></b> <span
style="color:#009900">$arg</span> <span style="color:#990000">=</span> <b><span
style="color:#0000FF">shift</span></b><span style="color:#990000">;</span>
+ <b><span style="color:#0000FF">return</span></b> <span
style="color:#009900">$arg</span> <span style="color:#990000">+</span> <span
style="color:#993399">4</span><span style="color:#990000">;</span>
+<span style="color:#FF0000">}</span>
+_______________________________________ highlight texinfo _GT Haib0aik zei4YieH
+</pre>
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_texinfo_input.texi
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_texinfo_input.texi
new file mode 100644
index 0000000000..880b150920
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_texinfo_input.texi
@@ -0,0 +1,6 @@
+Automatically generated
+
+_______________________ 0
+texinfo
+@code{protected}
+_______________________ 0
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_texinfo_output.html
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_texinfo_output.html
new file mode 100644
index 0000000000..a9ec0f0639
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example/highlight_example_highlight_texinfo_output.html
@@ -0,0 +1,9 @@
+<!-- Generator: GNU source-highlight
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>_______________________________________ highlight texinfo _GT Haib0aik
zei4YieH
+texinfo
+<i><span style="color:#9A1900">@code{protected}</span></i>
+_______________________________________ highlight texinfo _GT Haib0aik zei4YieH
+</pre>
diff --git a/tp/tests/test_scripts/other_highlight_syntax_example.sh
b/tp/tests/test_scripts/other_highlight_syntax_example.sh
new file mode 100755
index 0000000000..2b37620f49
--- /dev/null
+++ b/tp/tests/test_scripts/other_highlight_syntax_example.sh
@@ -0,0 +1,25 @@
+#! /bin/sh
+# This file generated by maintain/regenerate_cmd_tests.sh
+
+if test z"$srcdir" = "z"; then
+ srcdir=.
+fi
+
+one_test_logs_dir=test_log
+
+
+
+if test "z$OTHER_TESTS" != z"yes"; then
+ echo "Skipping other tests that are not easily reproducible"
+ exit 77
+fi
+
+dir=other
+name='highlight_syntax_example'
+mkdir -p $dir
+
+"$srcdir"/run_parser_all.sh -dir $dir $name
+exit_status=$?
+cat $dir/$one_test_logs_dir/$name.log
+exit $exit_status
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/init/highlight_syntax.pm (highlight_open_inline_container_type) (highlight_preformatted_command): update to match with changes in HTML output.,
Patrice Dumas <=