mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
docbook-fixup.pl:
Fixed some issues for O'Reilly. * Remove "mailto:" from @email{} references in XML output. Good for normal XML of course, but bad when printing. * Removing (Cross)References for sections that have been excluded from printed manual. * In several titles, spaces are missing. You see a title like: <title>Speed of <command>INSERT</command>Queries</title>.
This commit is contained in:
@ -29,6 +29,14 @@ print STDERR "Adding PARA inside ENTRY...\n";
|
||||
$data =~ s{<entry>(.+?)</entry>}
|
||||
{<entry><para>$1</para></entry>}gs;
|
||||
|
||||
print STDERR "Removing mailto: from email addresses...\n";
|
||||
$data =~ s{mailto:}
|
||||
{}gs;
|
||||
|
||||
print STDERR "Fixing spacing problem with titles...\n";
|
||||
$data =~ s{</(\w+)>(\w+)}
|
||||
{</$1> $2}gs;
|
||||
|
||||
@apx = ("Users", "MySQL Testimonials", "News",
|
||||
"GPL-license", "LGPL-license");
|
||||
|
||||
@ -36,6 +44,22 @@ foreach $apx (@apx) {
|
||||
print STDERR "Removing appendix $apx...\n";
|
||||
$data =~ s{<appendix id=\"$apx\">(.+?)</appendix>}
|
||||
{}gs;
|
||||
|
||||
print STDERR " ... Building list of removed nodes ...\n";
|
||||
foreach(split "\n", $&) {
|
||||
push @nodes, $2 if(/<(\w+) id=\"(.+?)\">/)
|
||||
};
|
||||
};
|
||||
|
||||
print STDERR "Fixing references to removed nodes...\n";
|
||||
foreach $node (@nodes) {
|
||||
$web = $node;
|
||||
$web =~ s/[ ]/_/;
|
||||
$web = "http://www.mysql.com/doc/" .
|
||||
(join "/", (split //, $web)[0..1])."/$web.html";
|
||||
print STDERR "$node -> $web\n";
|
||||
$data =~ s{<(\w+) linkend=\"$node\">}
|
||||
{$web}gs;
|
||||
};
|
||||
|
||||
print STDOUT $data;
|
||||
|
Reference in New Issue
Block a user