diff options
author | unknown <arjen@fred.bitbike.com> | 2002-05-02 16:31:03 +1000 |
---|---|---|
committer | unknown <arjen@fred.bitbike.com> | 2002-05-02 16:31:03 +1000 |
commit | d2fcac48e4604779c1f6e79e3e0d3ef9b4b65879 (patch) | |
tree | 2e958633de15c9093466e222186367380f54a4dc /Docs/Support | |
parent | 52da09aeaf9fc0b107dcb87663644ae4848c71aa (diff) | |
download | mariadb-git-d2fcac48e4604779c1f6e79e3e0d3ef9b4b65879.tar.gz |
(hopefully) final fixups for O'Reilly and XML/DocBook.
Docs/Manual_style_guidelines.txt:
Updated guidelines, mostly identified globals from O'Reilly proofread.
Docs/Support/docbook-fixup.pl:
Added post-processing for new docbook-prefix preprocessing.
Shuffled/fixed some other minor stuff.
Docs/Support/make-docbook:
Include preprocessing before makeinfo.
Docs/manual.texi:
Processing O'Reilly proofread, including global style changes.
Watch this one VERY VERY carefully - it's extremely drastic!
Diffstat (limited to 'Docs/Support')
-rwxr-xr-x | Docs/Support/docbook-fixup.pl | 40 | ||||
-rwxr-xr-x | Docs/Support/docbook-prefix.pl | 50 | ||||
-rwxr-xr-x | Docs/Support/make-docbook | 3 |
3 files changed, 87 insertions, 6 deletions
diff --git a/Docs/Support/docbook-fixup.pl b/Docs/Support/docbook-fixup.pl index 5528a114b87..f9934822f40 100755 --- a/Docs/Support/docbook-fixup.pl +++ b/Docs/Support/docbook-fixup.pl @@ -3,7 +3,7 @@ # Fix the output of `makeinfo --docbook` version 4.0c # Convert the broken docbook output to well-formed XML that conforms to the O'Reilly idiom # See code for detailed comments -# Authors: Arjen Lentz and Zak Greant +# Authors: Arjen Lentz and Zak Greant (original code by Jeremy Cole) use strict; @@ -13,7 +13,7 @@ my $apx = ''; my @nodes = (); my $nodes = ''; -msg ("\n-- Post-processing `makeinfo --docbook` output --"); +msg ("-- Post-processing `makeinfo --docbook` output --"); msg ("** Written to work with makeinfo version 4.0c **\n"); msg ("Discarding DTD - not required by subsequent scripts"); @@ -31,6 +31,26 @@ msg ("Add missing <bookinfo> and <abstract> opening tags"); # ...as soon as we find the first instance, we can stop looking. $data =~ s/<book lang="en">/<book lang="en"><bookinfo><abstract>/; + +# arjen 2002-05-01 +msg ("Processing docbook-prefix special strings"); +$data =~ s/FIXUPmdashFIXUP/\&mdash\;/g; + +$data =~ s/FIXUPdoubledashFIXUP/--/g; + +$data =~ s/FIXUPstrongFIXUP/<emphasis\ role\=bold>/g; +$data =~ s/FIXUPendstrongFIXUP/<\/emphasis>/g; + +$data =~ s/FIXUPemphFIXUP/<emphasis>/g; +$data =~ s/FIXUPendemphFIXUP/<\/emphasis>/g; + +$data =~ s/FIXUPfileFIXUP/<filename>/g; +$data =~ s/FIXUPendfileFIXUP/<\/filename>/g; + +$data =~ s/FIXUPsampFIXUP/<literal>/g; +$data =~ s/FIXUPendsampFIXUP/<\/literal>/g; + + msg ("Removing mailto: from email addresses..."); $data =~ s/mailto://g; @@ -38,9 +58,19 @@ msg ("Removing INFORMALFIGURE..."); $data =~ s{<informalfigure>.+?</informalfigure>} {}gs; -msg ("Convert ampersands to XML escape sequences "); +msg ("Convert ampersand to XML escape sequence..."); $data =~ s/&(?!\w+;)/&/g; - + +# arjen 2002-05-01 +msg ("Changing (TM) to XML escape sequence..."); +$data =~ s/MySQL \(TM\)/MySQL™/g; +$data =~ s{<command>TM</command>} + {™}g; + +# arjen 2002-05-01 +msg ("Changing ' -- ' to XML escape sequence..."); +$data =~ s/ -- /—/g; + msg ("Changing @@ to @..."); $data =~ s/@@/@/g; @@ -142,7 +172,7 @@ exit; # sub msg { - print STDERR shift, "\n"; + print STDERR "docbook-fixup:", shift, "\n"; } sub strip_tag($$) { diff --git a/Docs/Support/docbook-prefix.pl b/Docs/Support/docbook-prefix.pl new file mode 100755 index 00000000000..e76d84dbfe0 --- /dev/null +++ b/Docs/Support/docbook-prefix.pl @@ -0,0 +1,50 @@ +#!/usr/bin/perl -w + +# Preprocess the input of `makeinfo --docbook` version 4.0c +# Authors: Arjen Lentz and Zak Greant (started by arjen 2002-05-01) + +use strict; + +my $data = ''; + +msg ("-- Pre-processing `makeinfo --docbook` input --"); +msg ("** Written to work with makeinfo version 4.0c **\n"); + +# <> is a magic filehandle - either reading lines from stdin or from file(s) specified on the command line +msg ("Get the data"); +$data = join "", <>; + +msg ("Replacing '\@-' with FIXUPmdashFIXUP"); +$data =~ s/\@-/FIXUPmdashFIXUP/g; + +msg ("Replacing '--' with FIXUPdoubledashFIXUP"); +$data =~ s/--/FIXUPdoubledashFIXUP/g; + +msg ("Turning \@strong{} into LITERAL blocks"); +$data =~ s/\@strong\{(.*?)\}/FIXUPstrongFIXUP$1FIXUPendstrongFIXUP/gs; + +msg ("Turning \@emph{} into LITERAL blocks"); +$data =~ s/\@emph\{(.*?)\}/FIXUPemphFIXUP$1FIXUPendemphFIXUP/gs; + +msg ("Turning \@file{} into LITERAL blocks"); +$data =~ s/\@file\{(.*?)\}/FIXUPfileFIXUP$1FIXUPendfileFIXUP/gs; + +msg ("Turning \@samp{} into LITERAL blocks"); +$data =~ s/\@samp\{\@\{\}/FIXUPsampFIXUP\@\{FIXUPendsampFIXUP/g; +$data =~ s/\@samp\{\@\}\}/FIXUPsampFIXUP\@\}FIXUPendsampFIXUP/g; +$data =~ s/\@samp\{\@\{n\@\}\}/FIXUPsampFIXUP\@\{n\@\}FIXUPendsampFIXUP/g; +$data =~ s/\@samp\{(.*?)\}/FIXUPsampFIXUP$1FIXUPendsampFIXUP/gs; + + +msg ("Write the data"); +print STDOUT $data; +exit; + +# +# Definitions for helper sub-routines +# + +sub msg { + print STDERR "docbook-prefix: ", shift, "\n"; +} + diff --git a/Docs/Support/make-docbook b/Docs/Support/make-docbook index 90c1696e92b..93dbc56c0f8 100755 --- a/Docs/Support/make-docbook +++ b/Docs/Support/make-docbook @@ -17,7 +17,8 @@ sed -e 's;MYSQL_TCP_PORT_DEFAULT=;;' >> include.texi # produce DocBook XML - makeinfo --force --no-ifinfo --docbook -o - manual.texi |\ + Support/docbook-prefix.pl < manual.texi |\ + makeinfo --force --no-ifinfo --docbook -o - |\ Support/docbook-fixup.pl > mysql.xml # See if the XML output is well-formed |