mirror of https://github.com/tLDP/LDP
updated, still problems with generating internal links
This commit is contained in:
parent
94616188bd
commit
658e3dcb29
|
@ -17,7 +17,9 @@ they will be adjusted to conform to DocBook rules.
|
||||||
|
|
||||||
Almost none of the layout information in Texinfo carries over into DocBook.
|
Almost none of the layout information in Texinfo carries over into DocBook.
|
||||||
DocBook is a semantic language, not a layout or display language. You do your
|
DocBook is a semantic language, not a layout or display language. You do your
|
||||||
display in xsl. So, all of that information is just ignored.
|
display in xsl. So, all of that information is just ignored. Therefore, if you
|
||||||
|
are doing anything fancy with linespacing and such, it will not convert very
|
||||||
|
well.
|
||||||
|
|
||||||
texi2db has full support for macros, aliases, and custom highlighting with
|
texi2db has full support for macros, aliases, and custom highlighting with
|
||||||
@defenclosure commands.
|
@defenclosure commands.
|
||||||
|
@ -28,3 +30,12 @@ it because of its stage of development.
|
||||||
|
|
||||||
David Merrill
|
David Merrill
|
||||||
|
|
||||||
|
|
||||||
|
The following structures are not supported, at least not yet.
|
||||||
|
|
||||||
|
@dircategory
|
||||||
|
@direntry
|
||||||
|
@end direntry
|
||||||
|
|
||||||
|
All of the indexing commands.
|
||||||
|
@menu and friends are ignored for now, but I'm planning to support them later.
|
||||||
|
|
|
@ -45,7 +45,7 @@ $informalpara = 0;
|
||||||
$inpara = 0;
|
$inpara = 0;
|
||||||
|
|
||||||
# these maintain internal program state
|
# these maintain internal program state
|
||||||
#
|
#
|
||||||
$line = "";
|
$line = "";
|
||||||
$originalline = "";
|
$originalline = "";
|
||||||
$currentfile = "";
|
$currentfile = "";
|
||||||
|
@ -63,9 +63,15 @@ $literal = "";
|
||||||
$sgmlfile = "";
|
$sgmlfile = "";
|
||||||
$title = "";
|
$title = "";
|
||||||
$authorname = "";
|
$authorname = "";
|
||||||
$abstract = "";
|
|
||||||
$buf = "";
|
$buf = "";
|
||||||
|
|
||||||
|
# these are used when parsing the line for commands
|
||||||
|
#
|
||||||
|
$command;
|
||||||
|
$tag;
|
||||||
|
$tagplain;
|
||||||
|
$contents;
|
||||||
|
|
||||||
# these hold information about the node we are currently in, if any
|
# these hold information about the node we are currently in, if any
|
||||||
#
|
#
|
||||||
$nodename = "";
|
$nodename = "";
|
||||||
|
@ -78,6 +84,7 @@ $nodeinit = 0;
|
||||||
# remember this hierarchical information for every node
|
# remember this hierarchical information for every node
|
||||||
# we use it if the node doesn't specify a level.
|
# we use it if the node doesn't specify a level.
|
||||||
#
|
#
|
||||||
|
%nodenames = ();
|
||||||
%nodenexts = ();
|
%nodenexts = ();
|
||||||
%nodeprevs = ();
|
%nodeprevs = ();
|
||||||
%nodeups = ();
|
%nodeups = ();
|
||||||
|
@ -96,6 +103,7 @@ $nodeinit = 0;
|
||||||
#
|
#
|
||||||
$pattern = "";
|
$pattern = "";
|
||||||
$action = "";
|
$action = "";
|
||||||
|
$replacement = "";
|
||||||
|
|
||||||
# In the following hash, the perl expressions are used to search
|
# In the following hash, the perl expressions are used to search
|
||||||
# each line of the input file. If matched, the Action field defines
|
# each line of the input file. If matched, the Action field defines
|
||||||
|
@ -137,6 +145,8 @@ $action = "";
|
||||||
'^\@contents\b' =>'DROPLINE',
|
'^\@contents\b' =>'DROPLINE',
|
||||||
'^\@defindex\b' =>'DROPLINE', # TODO
|
'^\@defindex\b' =>'DROPLINE', # TODO
|
||||||
'^\@definfoenclose' =>'DEFINFOENCLOSE',
|
'^\@definfoenclose' =>'DEFINFOENCLOSE',
|
||||||
|
'^\@dircategory' =>'DROPLINE',
|
||||||
|
'^\@direntry' =>'SEEKEND',
|
||||||
'^\@display\b' =>'LITERALBLOCK',
|
'^\@display\b' =>'LITERALBLOCK',
|
||||||
'^\@enumerate\b' =>'ORDEREDLIST',
|
'^\@enumerate\b' =>'ORDEREDLIST',
|
||||||
'^\@end enumerate\b' =>'ORDEREDLISTEND',
|
'^\@end enumerate\b' =>'ORDEREDLISTEND',
|
||||||
|
@ -145,17 +155,18 @@ $action = "";
|
||||||
'^\@headings\b' =>'DROPLINE',
|
'^\@headings\b' =>'DROPLINE',
|
||||||
'^\@html\b' =>'SEEKEND',
|
'^\@html\b' =>'SEEKEND',
|
||||||
'^\@end html\b' =>'DROLINE',
|
'^\@end html\b' =>'DROLINE',
|
||||||
'^\@ifhtml\b' =>'DROPLINE',
|
'^\@ifhtml\b' =>'SEEKEND',
|
||||||
'^\@end ifhtml\b' =>'DROPLINE',
|
'^\@end ifhtml\b' =>'DROPLINE',
|
||||||
'^\@ifinfo\b' =>'SEEKEND',
|
'^\@ifinfo\b' =>'SEEKEND',
|
||||||
'^\@end ifinfo\b' =>'DROPLINE',
|
'^\@end ifinfo\b' =>'DROPLINE',
|
||||||
'^\@ifnottex\b' =>'DROPLINE',
|
'^\@ifnottex\b' =>'SEEKEND',
|
||||||
'^\@end ifnottex\b' =>'DROPLINE',
|
'^\@end ifnottex\b' =>'DROPLINE',
|
||||||
'^\@ifset\b' =>'IFSET', # handled like SEEKEND
|
'^\@ifset\b' =>'IFSET', # handled like SEEKEND
|
||||||
'^\@end ifset\b' =>'DROPLINE', # or ignored, so ignore this too
|
'^\@end ifset\b' =>'DROPLINE', # or ignored, so ignore this too
|
||||||
'^\@ifclear\b' =>'IFCLEAR',
|
'^\@ifclear\b' =>'IFCLEAR',
|
||||||
'^\@end ifclear\b' =>'DROPLINE',
|
'^\@end ifclear\b' =>'DROPLINE',
|
||||||
'^\@iftex\b' =>'SEEKEND',
|
'^\@iftex\b' =>'DROPLINE',
|
||||||
|
'^\@end iftex\b' =>'DROPLINE',
|
||||||
'^\@ignore\b' =>'SEEKEND',
|
'^\@ignore\b' =>'SEEKEND',
|
||||||
'^\@itemize\b' =>'ITEMIZEDLIST',
|
'^\@itemize\b' =>'ITEMIZEDLIST',
|
||||||
'^\@end itemize\b' =>'ITEMIZEDLISTEND',
|
'^\@end itemize\b' =>'ITEMIZEDLISTEND',
|
||||||
|
@ -175,6 +186,8 @@ $action = "";
|
||||||
'^\@sp\b' =>'DROPLINE',
|
'^\@sp\b' =>'DROPLINE',
|
||||||
'^\@table\b' =>'TABLE',
|
'^\@table\b' =>'TABLE',
|
||||||
'^\@end table\b' =>'TABLEEND',
|
'^\@end table\b' =>'TABLEEND',
|
||||||
|
'^\@vtable\b' =>'TABLE',
|
||||||
|
'^\@end vtable\b' =>'TABLEEND',
|
||||||
'^\@tex\b' =>'SEEKEND',
|
'^\@tex\b' =>'SEEKEND',
|
||||||
'^\@titlepage\b' =>'SEEKEND',
|
'^\@titlepage\b' =>'SEEKEND',
|
||||||
|
|
||||||
|
@ -215,94 +228,100 @@ $action = "";
|
||||||
#
|
#
|
||||||
# Note: Only the left side should be escaped!
|
# Note: Only the left side should be escaped!
|
||||||
#
|
#
|
||||||
# Example: @copyright{} becomes ©
|
|
||||||
#
|
|
||||||
%substitutions = (
|
%substitutions = (
|
||||||
'\@!' =>'!',
|
'@.' =>'.',
|
||||||
'\@\*' =>'',
|
'@!' =>'!',
|
||||||
'\@\s' =>' ',
|
'@*' =>'',
|
||||||
'\@"A' =>'Ä',
|
'@s' =>' ',
|
||||||
'\@"E' =>'Ë',
|
'@"A' =>'Ä',
|
||||||
'\@"I' =>'Ï',
|
'@"E' =>'Ë',
|
||||||
'\@"O' =>'Ö',
|
'@"I' =>'Ï',
|
||||||
'\@"U' =>'Ü',
|
'@"O' =>'Ö',
|
||||||
'\@"a' =>'ä',
|
'@"U' =>'Ü',
|
||||||
'\@"e' =>'ë',
|
'@"a' =>'ä',
|
||||||
'\@"i' =>'ï',
|
'@"e' =>'ë',
|
||||||
'\@"o' =>'ö',
|
'@"i' =>'ï',
|
||||||
'\@"u' =>'ü',
|
'@"o' =>'ö',
|
||||||
'\@' . "'" . 'A' =>'Á',
|
'@"u' =>'ü',
|
||||||
'\@' . "'" . 'E' =>'É',
|
'@' . "'" . 'A' =>'Á',
|
||||||
'\@' . "'" . 'I' =>'Í',
|
'@' . "'" . 'E' =>'É',
|
||||||
'\@' . "'" . 'O' =>'Ó',
|
'@' . "'" . 'I' =>'Í',
|
||||||
'\@' . "'" . 'U' =>'Ú',
|
'@' . "'" . 'O' =>'Ó',
|
||||||
'\@' . "'" . 'a' =>'á',
|
'@' . "'" . 'U' =>'Ú',
|
||||||
'\@' . "'" . 'e' =>'é',
|
'@' . "'" . 'a' =>'á',
|
||||||
'\@' . "'" . 'i' =>'í',
|
'@' . "'" . 'e' =>'é',
|
||||||
'\@' . "'" . 'o' =>'ó',
|
'@' . "'" . 'i' =>'í',
|
||||||
'\@' . "'" . 'u' =>'ú',
|
'@' . "'" . 'o' =>'ó',
|
||||||
'\@,{c}' =>'¸',
|
'@' . "'" . 'u' =>'ú',
|
||||||
'\@-' =>'¯',
|
'@,{c}' =>'¸',
|
||||||
'\@\.' =>'.',
|
'@-' =>'¯',
|
||||||
'\@:' =>'',
|
'@\.' =>'.',
|
||||||
'\@=' =>'',
|
'@:' =>'',
|
||||||
'\@\?' =>'?',
|
'@=' =>'',
|
||||||
'\@^A' =>'Â',
|
'@\?' =>'?',
|
||||||
'\@^E' =>'Ê',
|
'@^A' =>'Â',
|
||||||
'\@^I' =>'Î',
|
'@^E' =>'Ê',
|
||||||
'\@^O' =>'Ô',
|
'@^I' =>'Î',
|
||||||
'\@^U' =>'Û',
|
'@^O' =>'Ô',
|
||||||
'\@^a' =>'â',
|
'@^U' =>'Û',
|
||||||
'\@^e' =>'ê',
|
'@^a' =>'â',
|
||||||
'\@^i' =>'î',
|
'@^e' =>'ê',
|
||||||
'\@^o' =>'ô',
|
'@^i' =>'î',
|
||||||
'\@^u' =>'û',
|
'@^o' =>'ô',
|
||||||
'\@`A' =>'À',
|
'@^u' =>'û',
|
||||||
'\@`E' =>'È',
|
'@`A' =>'À',
|
||||||
'\@`I' =>'Ì',
|
'@`E' =>'È',
|
||||||
'\@`O' =>'Ò',
|
'@`I' =>'Ì',
|
||||||
'\@`U' =>'Ù',
|
'@`O' =>'Ò',
|
||||||
'\@`a' =>'à',
|
'@`U' =>'Ù',
|
||||||
'\@`e' =>'è',
|
'@`a' =>'à',
|
||||||
'\@`i' =>'ì',
|
'@`e' =>'è',
|
||||||
'\@`o' =>'ò',
|
'@`i' =>'ì',
|
||||||
'\@`u' =>'ù',
|
'@`o' =>'ò',
|
||||||
# '\@\{' =>'{', # do these manually at the end so brackets match
|
'@`u' =>'ù',
|
||||||
# '\@\}' =>'}',
|
# '@\{' =>'{', # do these manually at the end so brackets match
|
||||||
'\@~A' =>'Ã',
|
# '@\}' =>'}',
|
||||||
'\@~E' =>'&Etilde;',
|
'@~A' =>'Ã',
|
||||||
'\@~I' =>'Ĩ',
|
'@~E' =>'&Etilde;',
|
||||||
'\@~O' =>'Õ',
|
'@~I' =>'Ĩ',
|
||||||
'\@~U' =>'Ũ',
|
'@~O' =>'Õ',
|
||||||
'\@~a' =>'ã',
|
'@~U' =>'Ũ',
|
||||||
'\@~e' =>'&etilde;',
|
'@~a' =>'ã',
|
||||||
'\@~i' =>'ĩ',
|
'@~e' =>'&etilde;',
|
||||||
'\@~o' =>'õ',
|
'@~i' =>'ĩ',
|
||||||
'\@~u' =>'ũ',
|
'@~o' =>'õ',
|
||||||
'\@AA\{\}' =>'Å',
|
'@~u' =>'ũ',
|
||||||
'\@aa\{\}' =>'å',
|
'@center' =>'',
|
||||||
'\@AE\{\}' =>'Æ',
|
'@equiv' =>'≡',
|
||||||
'\@ae\{\}' =>'æ',
|
'@group' =>'',
|
||||||
'\@copyright\{\}' =>'©',
|
'@end group' =>'',
|
||||||
'\@dots\{\}' =>'…',
|
'@exclamdown' =>'¡',
|
||||||
'\@center\b' =>'',
|
'@noindent' =>'',
|
||||||
'\@enddots\{\}' =>'…',
|
'@refill' =>'',
|
||||||
'\@equiv' =>'≡',
|
|
||||||
'\@group\b' =>'',
|
|
||||||
'\@end group\b' =>'',
|
|
||||||
'\@exclamdown' =>'¡',
|
|
||||||
'\@noindent\b' =>'',
|
|
||||||
'\@refill\b' =>'',
|
|
||||||
'\@result\{\}' =>'=>',
|
|
||||||
'\@TeX\{\}' =>'TeX',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
# these are inline tags that require some kind of programmatic control
|
# these are inline tags that require some kind of programmatic control
|
||||||
# because they do strange things.
|
# because they do strange things.
|
||||||
#
|
#
|
||||||
%specsubstitutions = (
|
%specsubstitutions = (
|
||||||
'\@uref\b' =>'UREF',
|
'@anchor' =>'ANCHOR',
|
||||||
'\@anchor\b' =>'ANCHOR',
|
'@ref' =>'REF',
|
||||||
|
'@uref' =>'UREF',
|
||||||
|
'@xref' =>'XREF',
|
||||||
|
'@bullet' =>'*',
|
||||||
|
'@kbd' =>'KBD',
|
||||||
|
'@AA' =>'Å',
|
||||||
|
'@aa' =>'å',
|
||||||
|
'@AE' =>'Æ',
|
||||||
|
'@ae' =>'æ',
|
||||||
|
'@copyright' =>'©',
|
||||||
|
'@dots' =>'…',
|
||||||
|
'@minus' =>'-',
|
||||||
|
'@O' =>'Ø',
|
||||||
|
'@o' =>'ø',
|
||||||
|
'@result' =>'=>',
|
||||||
|
'@TeX' =>'TeX',
|
||||||
|
'@enddots' =>'…',
|
||||||
);
|
);
|
||||||
|
|
||||||
# These are special block wrapping tags. When we hit one of these,
|
# These are special block wrapping tags. When we hit one of these,
|
||||||
|
@ -327,20 +346,23 @@ $action = "";
|
||||||
# Example: @code{foo} becomes <literal>foo</literal>.
|
# Example: @code{foo} becomes <literal>foo</literal>.
|
||||||
#
|
#
|
||||||
%tags = (
|
%tags = (
|
||||||
'\@acronym\b' =>'abbrev',
|
'@acronym' =>'abbrev',
|
||||||
'\@b\b' =>"emphasis role='bold'",
|
'@b' =>"emphasis role='bold'",
|
||||||
'\@cite\b' =>'citetitle',
|
'@cite' =>'citetitle',
|
||||||
'\@code\b' =>'literal',
|
'@code' =>'literal',
|
||||||
'\@command\b' =>'command',
|
'@command' =>'command',
|
||||||
'\@dfn\b' =>"emphasis role='bold'",
|
'@dfn' =>"emphasis role='bold'",
|
||||||
'\@email\b' =>'email',
|
'@key' =>'keycap',
|
||||||
'\@emph\b' =>'emphasis',
|
'@email' =>'email',
|
||||||
'\@env\b' =>'envvar',
|
'@emph' =>'emphasis',
|
||||||
'\@footnote\b' =>'footnote',
|
'@env' =>'envvar',
|
||||||
'\@file\b' =>'filename',
|
'@footnote' =>'footnote',
|
||||||
'\@i\b' =>'emphasis',
|
'@file' =>'filename',
|
||||||
'\@samp\b' =>'literal',
|
'@i' =>'emphasis',
|
||||||
'\@w\b' =>'',
|
'@samp' =>'literal',
|
||||||
|
'@sc' =>'',
|
||||||
|
'@t' =>'programlisting',
|
||||||
|
'@w' =>'',
|
||||||
);
|
);
|
||||||
|
|
||||||
# this is where definfoenclose definitions go, and they are processed last
|
# this is where definfoenclose definitions go, and they are processed last
|
||||||
|
@ -357,6 +379,7 @@ $macroargs = "";
|
||||||
$macrotext = "";
|
$macrotext = "";
|
||||||
%macrotext = ();
|
%macrotext = ();
|
||||||
|
|
||||||
|
%aliases = ();
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
@ -405,7 +428,7 @@ $verbose = 3 if ($verbose > 3);
|
||||||
&message("insanity mode on.") if ($verbose ==3);
|
&message("insanity mode on.") if ($verbose ==3);
|
||||||
|
|
||||||
if ($outputfile) {
|
if ($outputfile) {
|
||||||
&message("output will go to $outputfile") if (verbose);
|
&message("output will go to $outputfile") if ($verbose);
|
||||||
open($outfh, "> $outputfile");
|
open($outfh, "> $outputfile");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,6 +470,7 @@ LINE: while ($line = <$fh>) {
|
||||||
$currentfile = $filename;
|
$currentfile = $filename;
|
||||||
$currentline = $linenumber;
|
$currentline = $linenumber;
|
||||||
|
|
||||||
|
&cleanline;
|
||||||
$originalline = $line;
|
$originalline = $line;
|
||||||
$trimline;
|
$trimline;
|
||||||
|
|
||||||
|
@ -464,6 +488,8 @@ LINE: while ($line = <$fh>) {
|
||||||
$line =~ s/\@\{/DCM_LB/g;
|
$line =~ s/\@\{/DCM_LB/g;
|
||||||
$line =~ s/\@\}/DCM_RB/g;
|
$line =~ s/\@\}/DCM_RB/g;
|
||||||
|
|
||||||
|
# keep reading until we have only complete tags
|
||||||
|
#
|
||||||
if ($saveline) {
|
if ($saveline) {
|
||||||
$line = $saveline . ' ' . $line;
|
$line = $saveline . ' ' . $line;
|
||||||
$saveline = '';
|
$saveline = '';
|
||||||
|
@ -621,21 +647,13 @@ LINE: while ($line = <$fh>) {
|
||||||
close($fh);
|
close($fh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub cleanline {
|
||||||
|
$line =~ s/\x0c//;
|
||||||
|
}
|
||||||
|
|
||||||
sub writefile {
|
sub writefile {
|
||||||
&closeappendix;
|
&closeappendix;
|
||||||
&message("copying meta-data to docbook") if ($verbose);
|
print $outfh $buf;
|
||||||
$template =~ s/%%TITLE/$title/;
|
|
||||||
$template =~ s/%%ABSTRACT/$abstract/;
|
|
||||||
$template =~ s/%%BODY/$buf/;
|
|
||||||
# &message("deleting empty tags") if ($verbose);
|
|
||||||
# $i = 0;
|
|
||||||
# while (1) {
|
|
||||||
# $template =~ s/\<(.+?)\>\W*\<\/\1\>//gs; # delete empty tags
|
|
||||||
# $i++;
|
|
||||||
# last if ($i == 10);
|
|
||||||
# }
|
|
||||||
&message("writing $outputfile") if ($verbose);
|
|
||||||
print $outfh $template . "\n";
|
|
||||||
print $outfh '</article>'. "\n";
|
print $outfh '</article>'. "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -667,261 +685,189 @@ sub matchblock {
|
||||||
# the rest are all inline processing
|
# the rest are all inline processing
|
||||||
#
|
#
|
||||||
sub convertinline {
|
sub convertinline {
|
||||||
&convertsubsts; # single characters, do immediately and after macros
|
|
||||||
&message(" SUBSTS: $line") if ($verbose > 1);
|
|
||||||
&convertmacros; # can insert new @{} commands, do first
|
|
||||||
&message(" MACROS: $line") if ($verbose > 1);
|
|
||||||
&convertsubsts; # single characters, do immediately and after macros
|
|
||||||
&message(" SUBSTS: $line") if ($verbose > 1);
|
|
||||||
&convertvalues; # insert variables, do immediately after macros
|
|
||||||
&message(" VALUES: $line") if ($verbose > 1);
|
|
||||||
&convertdefinfos; # custom highlighting, do after macros
|
|
||||||
&message(" DINFOS: $line") if ($verbose > 1);
|
|
||||||
&converttags; # @foo{bar} to <foo>bar</foo> do next to last
|
|
||||||
&message(" DBTAGS: $line") if ($verbose > 1);
|
|
||||||
&convertlinks; # @ref{} => <ulink>, do last
|
|
||||||
&message(" ULINKS: $line") if ($verbose > 1);
|
|
||||||
&convertspecsubsts; # @anchor{} => <anchor>, do last
|
|
||||||
&message(" ANCHOR: $line") if ($verbose > 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
# macros
|
# Do this first to avoid @@foo from being
|
||||||
#
|
# identified as a command later.
|
||||||
sub convertmacros {
|
$line =~ s/\@\@/\@/;
|
||||||
while (1) {
|
|
||||||
($macro, $macroargs, $macrotext) = &matchmacro();
|
TAG: while ($line =~ /\@\w+\{[^\{]*?\}/) {
|
||||||
last unless ($macro);
|
|
||||||
&message("matched macro $macro") if ($verbose > 1);
|
$command = $line;
|
||||||
if ($line =~ /\@$macro\{.*?\}/) {
|
$command =~ s/.*(\@\w+\{[^{]*?\}).*/\1/;
|
||||||
&replacemacro;
|
$tag = $command;
|
||||||
} else {
|
$tag =~ s/(.*)\{.*/\1/;
|
||||||
&raiseerror("unmatched macro brackets in line $line");
|
$tagplain = $tag;
|
||||||
last;
|
$tagplain =~ s/\@//;
|
||||||
|
$contents = $command;
|
||||||
|
$contents =~ s/.*\{(.*)\}/\1/;
|
||||||
|
&message("line: $line") if ($verbose > 1);
|
||||||
|
&message("command: $command") if ($verbose > 2);
|
||||||
|
&message("tag: $tag") if ($verbose > 2);
|
||||||
|
&message("tagplain: $tagplain") if ($verbose > 2);
|
||||||
|
&message("contents: $contents") if ($verbose > 2);
|
||||||
|
|
||||||
|
# substitutions (only @{} type will get caught here)
|
||||||
|
#
|
||||||
|
if (exists $substitutions{$tag}) {
|
||||||
|
$replacement = $substitutions{$tag};
|
||||||
|
&replaceinline;
|
||||||
|
next TAG;
|
||||||
}
|
}
|
||||||
&message("line is now $line") if ($verbose > 2);
|
|
||||||
}
|
# macros
|
||||||
}
|
#
|
||||||
|
if (exists $macros{$tagplain}) {
|
||||||
sub matchmacro {
|
$macro = $macros{$tagplain};
|
||||||
# &message("matchmacros $line");
|
$macroargs = "\\\\" . $macroargs{$tagplain} . "\\\\";
|
||||||
foreach $macro (keys %macroargs) {
|
$macrotext = $macrotext{$tagplain};
|
||||||
if ($line =~ /\@$macro\{/) {
|
|
||||||
return ($macro, $macroargs{$macro}, $macrotext{$macro});
|
$macroarg = $command;
|
||||||
|
$macroarg =~ s/^.*?\@$macro\{//;
|
||||||
|
$macroarg =~ s/\}.*?$//;
|
||||||
|
$macrotext =~ s/\@$macro\{([^\{]*?)\}/$macroarg/;
|
||||||
|
$macrotext =~ s/$macroargs/$macroarg/g;
|
||||||
|
$replacement = $macrotext;
|
||||||
|
&replaceinline;
|
||||||
|
next TAG;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub replacemacro {
|
# special character substitutions
|
||||||
my $macroarg = $line;
|
#
|
||||||
my $open;
|
if (exists $specsubstitutions{$tag}) {
|
||||||
my $close;
|
$replacement = $specsubstitutions{$tag};
|
||||||
$macroargs = "\\\\" . $macroargs . "\\\\";
|
&replacespecsubst;
|
||||||
$macroarg =~ s/^.*?\@$macro\{//;
|
&replaceinline;
|
||||||
$macroarg =~ s/\}.*?$//;
|
next TAG;
|
||||||
$macrotext =~ s/\@$macro\{([^\{]*?)\}/$macroarg/;
|
|
||||||
&message("replace pattern '$macroargs' with '$macroarg' in '$macrotext'") if ($verbose > 2);
|
|
||||||
$macrotext =~ s/$macroargs/$macroarg/g;
|
|
||||||
$line =~ s/\@$macro\{.*?\}/$macrotext/;
|
|
||||||
}
|
|
||||||
|
|
||||||
# character substitution
|
|
||||||
#
|
|
||||||
sub convertsubsts {
|
|
||||||
while (1) {
|
|
||||||
($pattern, $action) = &matchsubst();
|
|
||||||
last unless ($pattern);
|
|
||||||
&replacesubst;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub matchsubst {
|
|
||||||
foreach $key (keys %substitutions) {
|
|
||||||
if ($line =~ /$key/) {
|
|
||||||
return ($key, $substitutions{$key});
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ('', '');
|
# docbook wrapper tags
|
||||||
}
|
#
|
||||||
|
if (exists $tags{$tag}) {
|
||||||
sub replacesubst {
|
$replacement = $tags{$tag};
|
||||||
&message("replacing '$pattern' with '$action' on line $line") if ($verbose > 1);
|
if ($replacement) {
|
||||||
$line =~ s/$pattern/$action/g;
|
($tag, $attributes) = split(/ /, $replacement);
|
||||||
}
|
if ($attributes) {
|
||||||
|
$replacement = "\<$tag $attributes\>$contents\<\/$tag\>";
|
||||||
# special character substitution
|
} else {
|
||||||
#
|
$replacement = "\<$tag\>$contents\<\/$tag\>";
|
||||||
sub convertspecsubsts {
|
}
|
||||||
while (1) {
|
} else {
|
||||||
($pattern, $action) = &matchspecsubst();
|
$replacement = $contents;
|
||||||
last unless ($pattern);
|
}
|
||||||
&replacespecsubst;
|
&replaceinline;
|
||||||
}
|
next TAG;
|
||||||
}
|
|
||||||
|
|
||||||
sub matchspecsubst {
|
|
||||||
foreach $key (keys %specsubstitutions) {
|
|
||||||
if ($line =~ /$key/) {
|
|
||||||
return ($key, $specsubstitutions{$key});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (exists $definfos{$tagplain}){
|
||||||
|
$action = $definfos{$tagplain};
|
||||||
|
($prefix, $suffix) = split(/,/,$action);
|
||||||
|
$replacement = $prefix . $contents . $suffix;
|
||||||
|
&message("definfo prefix: $prefix, suffix: $suffix, contents: $contents") if ($verbose > 1);
|
||||||
|
&replaceinline;
|
||||||
|
next TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (exists $setvalues{$contents}) {
|
||||||
|
$replacement = $setvalues{$contents};
|
||||||
|
&replaceinline;
|
||||||
|
next TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (exists $aliases{$tag}) {
|
||||||
|
$replacement = $aliases{$tag} . '{' . $contents . '}';
|
||||||
|
&replaceinline;
|
||||||
|
next TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
&raiseerror("cannot resolve $command");
|
||||||
|
$replacement = "ERROR";
|
||||||
|
&replaceinline;
|
||||||
}
|
}
|
||||||
return ('', '');
|
|
||||||
|
# fix character-level substitutions.
|
||||||
|
#
|
||||||
|
for $key (keys %substitutions) {
|
||||||
|
$key = quotemeta($key);
|
||||||
|
$line =~ s/$key/$substitutions{$key}/g
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub replaceinline {
|
||||||
|
&message("replacing $command with $replacement") if ($verbose > 1);
|
||||||
|
$command = quotemeta($command);
|
||||||
|
$line =~ s/$command/$replacement/;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub replacespecsubst {
|
sub replacespecsubst {
|
||||||
|
my $anchor;
|
||||||
my $link;
|
my $link;
|
||||||
my $linkname;
|
my $linkname;
|
||||||
|
my $keystring;
|
||||||
&message("replacing 'special case' $pattern $action on line $line") if ($verbose > 2);
|
my @keycombos;
|
||||||
if ($action eq 'UREF') {
|
my @keycaps;
|
||||||
$link = $line;
|
my $mykeys;
|
||||||
$link =~ s/^.*?\@uref\{(.*?)\}.*$/\1/;
|
|
||||||
|
if ($replacement eq 'REF') {
|
||||||
|
&message("making xref on line $line") if ($verbose > 1);
|
||||||
|
$link = $contents;
|
||||||
|
$linktitle = &trim($link);
|
||||||
|
$link = &linkfix($link);
|
||||||
|
&message("link: $link, title; $linktitle") if ($verbose > 2);
|
||||||
|
&raiseerror("NO ANCHOR in $line") unless ($link);
|
||||||
|
|
||||||
|
# decide what kind of link to make based on whether it is
|
||||||
|
# to a section or not. Sections have titles that can be
|
||||||
|
# referenced using an xref. Anchors do not, and we have to
|
||||||
|
# render a full <link> tag.
|
||||||
|
#
|
||||||
|
if ($nodelevels{$link}) {
|
||||||
|
$replacement = "See \<xref linkend='$link' endterm='$link-title'\/\>";
|
||||||
|
} else {
|
||||||
|
$replacement = "See \<link linkend='$link'\>$linktitle\<\/link\>";
|
||||||
|
}
|
||||||
|
&message("made xref to tag $link on line: $line") if ($verbose > 1);
|
||||||
|
} elsif ($replacement eq 'UREF') {
|
||||||
|
$link = $contents;
|
||||||
($link, $linkname) = split(/,/, $link);
|
($link, $linkname) = split(/,/, $link);
|
||||||
$link = &trim($link);
|
$link = &trim($link);
|
||||||
$linkname = &trim($linkname);
|
$linkname = &trim($linkname);
|
||||||
$linkname = $link unless ($linkname);
|
$linkname = $link unless ($linkname);
|
||||||
$line =~ s/\@uref\{(.*?)\}/\<ulink url='$link'\>$linkname\<\/ulink\>/g;
|
$replacement = "\<ulink url='$link'\>$linkname\<\/ulink\>";
|
||||||
&message("ulink: $link, linkname: $linkname, line: $line"); # if ($verbose > 2);
|
&message("ulink: $link, linkname: $linkname, line: $line") if ($verbose > 2);
|
||||||
} elsif ($action eq 'ANCHOR') {
|
} elsif ($replacement eq 'XREF') {
|
||||||
|
($link, $linkname, $foo, $foo) = split(/,/, $contents);
|
||||||
$link = $line;
|
$link = &anchorfix(&trim($link));
|
||||||
$link =~ s/^.*?\@anchor\{(.*?)\}.*$/\1/;
|
$linkname = &trim($linkname);
|
||||||
|
$linkname = $link unless ($linkname);
|
||||||
|
&message("xref, contents: $contents, link: $link, linkname: $linkname");
|
||||||
|
if ($nodelevels{$link}) {
|
||||||
|
$replacement = "\<xref linkend='$link' endterm='$link-title'\/\>";
|
||||||
|
} else {
|
||||||
|
$replacement = "\<link linkend='$link'\>$linkname\<\/link\>";
|
||||||
|
}
|
||||||
|
} elsif ($replacement eq 'ANCHOR') {
|
||||||
|
$link = $contents;
|
||||||
$link = &anchorfix($link);
|
$link = &anchorfix($link);
|
||||||
$line =~ s/\@anchor\{(.*?)\}/<anchor id='$link'\/\>/;
|
$replacement = "<anchor id='$link'\/\>";
|
||||||
|
} elsif ($replacement eq 'KBD') {
|
||||||
# $line =~ s/\@anchor\{([^\}]*?)\}/\<anchor id='$link'\/\>/;
|
$keystring = $contents;
|
||||||
# $line =~ s/\@anchor\{([^\}]*?\{.*?\}.*?)\}/\<anchor id='$link'\/\>/;
|
@keycombos = split(/\s+/, $keystring);
|
||||||
# &message("anchor: $link on line: $line"); # if ($verbose > 2);
|
foreach $keycombo (@keycombos) {
|
||||||
} else {
|
&message("keycombo: $keycombo");
|
||||||
&raiseerror("Unrecognized 'special case' inline substitution code $pattern");
|
@keycaps = split('-', $keycombo);
|
||||||
}
|
if (length(@keycaps) > 1) {
|
||||||
}
|
$mykeys .= "\<keycombo action='simul'\>";
|
||||||
|
foreach $keycap (@keycaps) {
|
||||||
$loops = 0;
|
$mykeys .= "\<keycap\>$keycap\<\/keycap\>";
|
||||||
|
}
|
||||||
# replace @-Commands with DocBook tags
|
$mykeys .= '</keycombo>'
|
||||||
#
|
|
||||||
sub converttags {
|
|
||||||
$loops = 0;
|
|
||||||
while (1) {
|
|
||||||
($pattern, $action) = &matchtag();
|
|
||||||
last unless ($pattern);
|
|
||||||
if ($line =~ /$pattern.*?\}/) {
|
|
||||||
$loops++;
|
|
||||||
&replacetag;
|
|
||||||
exit if ($loops >= 25);
|
|
||||||
} else {
|
|
||||||
&raiseerror("unmatched tag brackets in line $line");
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub matchtag {
|
|
||||||
foreach $key (keys %tags) {
|
|
||||||
if ($line =~ /$key/) {
|
|
||||||
return ($key, $tags{$key});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ('', '');
|
|
||||||
}
|
|
||||||
|
|
||||||
sub replacetag {
|
|
||||||
my ($tag,
|
|
||||||
$attributes,
|
|
||||||
$part,
|
|
||||||
$newline,
|
|
||||||
$fragment,
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($action eq '') {
|
|
||||||
&message("removing old tag, but not adding a new one") if ($verbose > 2);
|
|
||||||
$line =~ s/$pattern\{([^\}]*?\{.*?\}.*?)\}/\1/g;
|
|
||||||
$line =~ s/$pattern\{([^\}]*?)\}/\1/g;
|
|
||||||
} else {
|
|
||||||
&message("replacing $pattern with $action tags on line $line") if ($verbose > 1);
|
|
||||||
($tag, $attributes) = split(/ /, $action);
|
|
||||||
if ($attributes) {
|
|
||||||
$line =~ s/$pattern\{([^\}]*?\{.*?\}.*?)\}/\<$tag $attributes\>\1\<\/$tag\>/g;
|
|
||||||
$line =~ s/$pattern\{([^\}]*?)\}/\<$tag $attributes\>\1\<\/$tag\>/g;
|
|
||||||
} else {
|
|
||||||
$line =~ s/$pattern\{([^\}]*?\{.*?\}.*?)\}/\<$tag\>\1\<\/$tag\>/g;
|
|
||||||
$line =~ s/$pattern\{([^\}]*?)\}/\<$tag\>\1\<\/$tag\>/g;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# replace @-Commands with custom highlighting
|
|
||||||
#
|
|
||||||
sub convertdefinfos {
|
|
||||||
while (1) {
|
|
||||||
($pattern, $action) = &matchdefinfo();
|
|
||||||
last unless ($pattern);
|
|
||||||
&message("matched definfoenclose '$pattern'") if ($verbose >2);
|
|
||||||
&replacedefinfo;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub matchdefinfo {
|
|
||||||
foreach $key (keys %definfos) {
|
|
||||||
if ($line =~ /$key\{.*?\}/) {
|
|
||||||
return ($key, $definfos{$key});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ('', '');
|
|
||||||
}
|
|
||||||
|
|
||||||
sub replacedefinfo {
|
|
||||||
($prefix, $suffix) = split(/,/,$action);
|
|
||||||
&message("pattern: $pattern, prefix: $prefix, suffix: $suffix") if ($verbose > 2);
|
|
||||||
$line =~ s/$pattern\{([^\}]*?\{.*?\}.*?)\}/$prefix\1$suffix/g;
|
|
||||||
$line =~ s/$pattern\{([^\}]*?)\}/$prefix\1$suffix/g;
|
|
||||||
$line =~ s/$pattern\{\}/$prefix$suffix/g;
|
|
||||||
&message("definfoenclose replaced") if ($verbose >2);
|
|
||||||
}
|
|
||||||
|
|
||||||
# replace @value{} with values
|
|
||||||
#
|
|
||||||
sub convertvalues {
|
|
||||||
my ($key,
|
|
||||||
$value);
|
|
||||||
|
|
||||||
foreach $key (keys %setvalues) {
|
|
||||||
$value = $setvalues{$key};
|
|
||||||
$line =~ s/\@value\{$key\}/$value/;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub convertlinks {
|
|
||||||
my $link,
|
|
||||||
$anchor;
|
|
||||||
|
|
||||||
while ($line =~ /\@ref\{/) {
|
|
||||||
if ($line =~ /\@ref\{.*?\}/) {
|
|
||||||
&message("making xref on line $line") if ($verbose > 1);
|
|
||||||
$anchor = $line;
|
|
||||||
$anchor =~ s/^.*?\@ref\{//;
|
|
||||||
$anchor =~ s/\}.*$//;
|
|
||||||
$anchortitle = &trim($anchor);
|
|
||||||
$anchor = &anchorfix($anchor);
|
|
||||||
&message("anchor: $anchor, title; $anchortitle") if ($verbose > 2);
|
|
||||||
&raiseerror("NO ANCHOR in $line") unless ($anchor);
|
|
||||||
|
|
||||||
# decide what kind of link to make based on whether it is
|
|
||||||
# to a section or not. Sections have titles that can be
|
|
||||||
# referenced using an xref. Anchors do not, and we have to
|
|
||||||
# render a full <link> tag.
|
|
||||||
#
|
|
||||||
if ($nodelevels{$anchor}) {
|
|
||||||
$link = "\<xref linkend='$anchor' endterm='$anchor-title'\/\>";
|
|
||||||
} else {
|
} else {
|
||||||
$link = "\<link linkend='$anchor'\>$anchortitle\<\/link\>";
|
$mykeys .= "\<keycap\>$keycaps[0]\<\/keycap\>";
|
||||||
}
|
}
|
||||||
$line =~ s/\@ref\{.*?\}/$link/;
|
|
||||||
&message("made xref to tag $anchor on line: $line") if ($verbose > 1);
|
|
||||||
} else {
|
|
||||||
&raiseerror("unmatched ref brackets in line $line");
|
|
||||||
last;
|
|
||||||
}
|
}
|
||||||
|
$replacement = $mykeys;
|
||||||
|
} else {
|
||||||
|
$replacement = $specsubstitutions{$tag};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1012,6 +958,10 @@ sub writeline {
|
||||||
$line =~ s/DCM_LB/\{/g;
|
$line =~ s/DCM_LB/\{/g;
|
||||||
$line =~ s/DCM_RB/\}/g;
|
$line =~ s/DCM_RB/\}/g;
|
||||||
$buf .= $line . "\n";
|
$buf .= $line . "\n";
|
||||||
|
if ($linenumber % 1000 == 0) {
|
||||||
|
print $outfh $buf;
|
||||||
|
$buf = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
##############################################
|
##############################################
|
||||||
|
@ -1049,17 +999,21 @@ sub node {
|
||||||
$nodeprev = &trim($nodeprev);
|
$nodeprev = &trim($nodeprev);
|
||||||
$nodenext = &trim($nodenext);
|
$nodenext = &trim($nodenext);
|
||||||
$nodeup = &trim($nodeup);
|
$nodeup = &trim($nodeup);
|
||||||
$nodenexts{$nodename} = $nodenext;
|
|
||||||
$nodeprevs{$nodename} = $nodeprev;
|
|
||||||
$nodeups{$nodename} = $nodeup;
|
|
||||||
$nodeinit = 0;
|
$nodeinit = 0;
|
||||||
&message("Name: $nodename Next: $nodenext Previous: $nodeprev Up: $nodeup") if ($verbose > 1);
|
&message("Name: $nodename Next: $nodenext Previous: $nodeprev Up: $nodeup") if ($verbose > 1);
|
||||||
&closeformalpara;
|
&closeformalpara;
|
||||||
if ($nodename eq 'Top') {
|
if ($inabstract) {
|
||||||
$inabstract = 0;
|
$inabstract = 0;
|
||||||
$abstract = $buf;
|
&message("copying meta-data to docbook") if ($verbose);
|
||||||
|
$template =~ s/%%TITLE/$title/;
|
||||||
|
$template =~ s/%%ABSTRACT/$buf/;
|
||||||
|
print $outfh $template . "\n";
|
||||||
$buf = "";
|
$buf = "";
|
||||||
}
|
}
|
||||||
|
$nodenames{$nodename} = $nodename;
|
||||||
|
$nodenexts{$nodename} = $nodenext;
|
||||||
|
$nodeprevs{$nodename} = $nodeprev;
|
||||||
|
$nodeups{$nodename} = $nodeup;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub appendix {
|
sub appendix {
|
||||||
|
@ -1068,7 +1022,7 @@ sub appendix {
|
||||||
$inappendix = 1;
|
$inappendix = 1;
|
||||||
$nodeinit = 1;
|
$nodeinit = 1;
|
||||||
$nodelevels{$nodename} = "A";
|
$nodelevels{$nodename} = "A";
|
||||||
&message("processing node $nodename at level $nodelevels{$nodename}");
|
&message("processing node $nodename at level $nodelevels{$nodename}") if ($verbose);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub sect1 {
|
sub sect1 {
|
||||||
|
@ -1077,7 +1031,7 @@ sub sect1 {
|
||||||
$insect1 = 1;
|
$insect1 = 1;
|
||||||
$nodeinit = 1;
|
$nodeinit = 1;
|
||||||
$nodelevels{$nodename} = 1;
|
$nodelevels{$nodename} = 1;
|
||||||
&message("set node $nodename level to $nodelevels{$nodename}");
|
&message("set node $nodename level to $nodelevels{$nodename}") if ($verbose > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub sect2 {
|
sub sect2 {
|
||||||
|
@ -1092,7 +1046,7 @@ sub sect2 {
|
||||||
$insect2 = 1;
|
$insect2 = 1;
|
||||||
$nodeinit = 1;
|
$nodeinit = 1;
|
||||||
$nodelevels{$nodename} = 2;
|
$nodelevels{$nodename} = 2;
|
||||||
&message("set node $nodename level to $nodelevels{$nodename}");
|
&message("set node $nodename level to $nodelevels{$nodename}") if ($verbose > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub sect3 {
|
sub sect3 {
|
||||||
|
@ -1107,7 +1061,7 @@ sub sect3 {
|
||||||
$insect3 = 1;
|
$insect3 = 1;
|
||||||
$nodeinit = 1;
|
$nodeinit = 1;
|
||||||
$nodelevels{$nodename} = 3;
|
$nodelevels{$nodename} = 3;
|
||||||
&message("set node $nodename level to $nodelevels{$nodename}");
|
&message("set node $nodename level to $nodelevels{$nodename}") if ($verbose > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub sect4 {
|
sub sect4 {
|
||||||
|
@ -1359,30 +1313,23 @@ sub ifset {
|
||||||
# META-LANGUAGE #
|
# META-LANGUAGE #
|
||||||
#################
|
#################
|
||||||
|
|
||||||
# only the commands in %tags are currently supported
|
|
||||||
#
|
|
||||||
sub alias {
|
sub alias {
|
||||||
my $alias;
|
my $alias;
|
||||||
|
|
||||||
($foo, $alias) = split(/\s/, $line);
|
($foo, $alias) = split(/\s/, $line);
|
||||||
&message("alias: $alias") if ($verbose > 2);
|
|
||||||
($alias, $command) = split(/=/, $alias);
|
($alias, $command) = split(/=/, $alias);
|
||||||
&message("alias: $alias, command: $command") if ($verbose > 2);
|
&message("alias: $alias, command: $command") if ($verbose > 2);
|
||||||
$alias = '\@' . $alias . '\b';
|
$aliases{'@' . $alias} = $command;
|
||||||
$command = '\@' . $command . '\b';
|
|
||||||
&message("alias: $alias, command: $command") if ($verbose > 2);
|
|
||||||
$tag = $tags{$command};
|
|
||||||
&message("tag: $tag") if ($verbose > 2);
|
|
||||||
$tags{$alias} = $tag;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub macro {
|
sub macro {
|
||||||
$line =~ s/\@macro\s*?(.*?)\{(.*?)\}/\1,\2/;
|
$line =~ s/\@macro\s+?(.*?)\{(.*?)\}/\1,\2/;
|
||||||
($macro, $macroargs) = split(/,/, $line);
|
($macro, $macroargs) = split(/,/, $line);
|
||||||
$macro = &trim($macro);
|
$macro = &trim($macro);
|
||||||
$macros{$macro} = $macro;
|
$macros{$macro} = $macro;
|
||||||
$macrotext = '';
|
$macrotext = '';
|
||||||
$inmacro = 1;
|
$inmacro = 1;
|
||||||
|
&message("adding macro $macro") if ($verbose > 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
# load custom @-commands
|
# load custom @-commands
|
||||||
|
@ -1396,10 +1343,9 @@ sub definfoenclose {
|
||||||
|
|
||||||
$line =~ s/\@definfoenclose\s+//;
|
$line =~ s/\@definfoenclose\s+//;
|
||||||
($name, $prefix, $suffix) = split(/,/, $line);
|
($name, $prefix, $suffix) = split(/,/, $line);
|
||||||
$key = '\@' . $name;
|
|
||||||
$replacement = $prefix. ',' . $suffix;
|
$replacement = $prefix. ',' . $suffix;
|
||||||
$definfos{$key} = $replacement;
|
$definfos{$name} = $replacement;
|
||||||
# &message("custom definfoenclosure: \[$name\] \[$prefix\] \[$suffix\] \/ \[$key\] \[$replacement\]") if ($verbose > 0);
|
&message("custom definfoenclosure: \[$name\] \[$prefix\] \[$suffix\]") if (verbose > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
###########
|
###########
|
||||||
|
@ -1494,7 +1440,9 @@ sub usage {
|
||||||
}
|
}
|
||||||
|
|
||||||
__END__
|
__END__
|
||||||
<!DOCTYPE ARTICLE PUBLIC "-//OASIS//DTD DocBook V4.1.2//EN" >
|
<?xml version='1.0'?>
|
||||||
|
<!DOCTYPE book PUBLIC '-//OASIS//DTD DocBook XML V4.1.2//EN'
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
|
||||||
|
|
||||||
<article>
|
<article>
|
||||||
<artheader>
|
<artheader>
|
||||||
|
@ -1503,5 +1451,4 @@ __END__
|
||||||
%%ABSTRACT
|
%%ABSTRACT
|
||||||
</abstract>
|
</abstract>
|
||||||
</artheader>
|
</artheader>
|
||||||
%%BODY
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue