From 684570b0277ce771fc66bcfdbe352eeaa541786d Mon Sep 17 00:00:00 2001 From: ddomingo Date: Mon, 2 Mar 2009 11:54:01 +1000 Subject: added publicanizer for langref --- doc/Language_Reference_Guide/README | 16 + .../en-US/Author_Group.xml | 16 + doc/Language_Reference_Guide/en-US/Book_Info.xml | 63 + .../en-US/Language_Reference_Guide.ent | 2 + doc/Language_Reference_Guide/en-US/Preface.xml | 13 + .../en-US/Revision_History.xml | 26 + doc/Language_Reference_Guide/en-US/images/icon.svg | 3936 ++++++++++++++++++++ .../publicanize-langref.sh | 157 + 8 files changed, 4229 insertions(+) create mode 100644 doc/Language_Reference_Guide/README create mode 100644 doc/Language_Reference_Guide/en-US/Author_Group.xml create mode 100644 doc/Language_Reference_Guide/en-US/Book_Info.xml create mode 100644 doc/Language_Reference_Guide/en-US/Language_Reference_Guide.ent create mode 100644 doc/Language_Reference_Guide/en-US/Preface.xml create mode 100644 doc/Language_Reference_Guide/en-US/Revision_History.xml create mode 100644 doc/Language_Reference_Guide/en-US/images/icon.svg create mode 100755 doc/Language_Reference_Guide/publicanize-langref.sh (limited to 'doc/Language_Reference_Guide') diff --git a/doc/Language_Reference_Guide/README b/doc/Language_Reference_Guide/README new file mode 100644 index 00000000..d3175ae3 --- /dev/null +++ b/doc/Language_Reference_Guide/README @@ -0,0 +1,16 @@ +This is an automated source build of the Language Reference Guide, +used to build it in Publican. + +To build the source, run: + + bash publicanize-langref.sh + +This will copy the LaTeX source of the Language Reference Guide and +convert it to DocBook XML. You can now build it in pdf, html, etc +using Publican. + +The main source of the Language Reference Guide is in: + ../langref.tex + +As such, any revisions to this document should be applied to ../langref.tex, +not to the source in this directory. diff --git a/doc/Language_Reference_Guide/en-US/Author_Group.xml b/doc/Language_Reference_Guide/en-US/Author_Group.xml new file mode 100644 index 00000000..00df1c7d --- /dev/null +++ b/doc/Language_Reference_Guide/en-US/Author_Group.xml @@ -0,0 +1,16 @@ + + + + + + + Robb + Romans + + IBM + Documentation + + robb@linux.vnet.ibm.com + + diff --git a/doc/Language_Reference_Guide/en-US/Book_Info.xml b/doc/Language_Reference_Guide/en-US/Book_Info.xml new file mode 100644 index 00000000..14a34093 --- /dev/null +++ b/doc/Language_Reference_Guide/en-US/Book_Info.xml @@ -0,0 +1,63 @@ + + + + + Language Reference Guide + A guide to the constructs and syntax used in SystemTap scripts + Fedora + 10 + 1 + 1 + + + The SystemTap Language Reference Guide is a + comprehensive reference of the language constructs and syntax used in + SystemTap scripts. It is suitable for users who have intermediate to + advanced knowledge of SystemTap. For other available SystemTap documentation, + refer to . + + + + + + + + Logo + + + + + + + Copyright © 2007 Red Hat Inc., Copyright © 2007 IBM Corp., Copyright © 2007 Intel Corporation. + + + + This document was derived from other documents contributed to the SystemTap project by employees of Red Hat, IBM and Intel. + + + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + + + The GNU Free Documentation License is available from + or by writing to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + + + + + + + + + diff --git a/doc/Language_Reference_Guide/en-US/Language_Reference_Guide.ent b/doc/Language_Reference_Guide/en-US/Language_Reference_Guide.ent new file mode 100644 index 00000000..e44f36cb --- /dev/null +++ b/doc/Language_Reference_Guide/en-US/Language_Reference_Guide.ent @@ -0,0 +1,2 @@ + + diff --git a/doc/Language_Reference_Guide/en-US/Preface.xml b/doc/Language_Reference_Guide/en-US/Preface.xml new file mode 100644 index 00000000..9e8995e3 --- /dev/null +++ b/doc/Language_Reference_Guide/en-US/Preface.xml @@ -0,0 +1,13 @@ + + + + + Preface + + + + + + + diff --git a/doc/Language_Reference_Guide/en-US/Revision_History.xml b/doc/Language_Reference_Guide/en-US/Revision_History.xml new file mode 100644 index 00000000..68432a02 --- /dev/null +++ b/doc/Language_Reference_Guide/en-US/Revision_History.xml @@ -0,0 +1,26 @@ + + + + + Revision History + + + + 1.0 + + + + + + + + + + + + + + + + diff --git a/doc/Language_Reference_Guide/en-US/images/icon.svg b/doc/Language_Reference_Guide/en-US/images/icon.svg new file mode 100644 index 00000000..c471a607 --- /dev/null +++ b/doc/Language_Reference_Guide/en-US/images/icon.svg @@ -0,0 +1,3936 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id="path2858" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/Language_Reference_Guide/publicanize-langref.sh b/doc/Language_Reference_Guide/publicanize-langref.sh new file mode 100755 index 00000000..fd4edf6a --- /dev/null +++ b/doc/Language_Reference_Guide/publicanize-langref.sh @@ -0,0 +1,157 @@ +#!/bin/bash +#this script converts the langref.tex source for the Language Reference Guide into +#DocBook XML. the conversion is done thru latexml, a utility that comes with dblatex-0.2.7. +#the output xml file of latexml is pretty dirty, so this script is needed to further clean it up. + +#copy latex file to here +cp ../langref.tex . + +#convert it to raw xml +latexml langref.tex --dest=Language_Reference_Guide.xml + +#remove excess whitespace +sed -i -e 's/^\s*//g' Language_Reference_Guide.xml + +sed -i -e 's///g' Language_Reference_Guide.xml + +cat Language_Reference_Guide.xml | +perl -p -e 'undef $/;s|\n<\?latexml options="twoside,english" class="article"\?>\n<\?latexml package="geometry"\?>\n<\?latexml RelaxNGSchema="LaTeXML"\?>\n<\?latexml RelaxNGSchema="LaTeXML"\?>\n\nSystemTap Language Reference|<\!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ +]>\n\n|msg' | +perl -p -e 'undef $/;s|\n

This document was derived from other documents contributed to the SystemTap project by employees of Red Hat, IBM and Intel.

\n
\n\n

Copyright © 2007 Red Hat Inc.\nCopyright © 2007 IBM Corp.\nCopyright © 2007 Intel Corporation.

\n
\n\n

Permission is granted to copy, distribute and/or modify this document\nunder the terms of the GNU Free Documentation License, Version 1.2\nor any later version published by the Free Software Foundation;\nwith no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.

\n
\n\n

The GNU Free Documentation License is available from\nhttp://www.gnu.org/licenses/fdl.html or by writing to\nthe Free Software Foundation, Inc., 51 Franklin Street,\nFifth Floor, Boston, MA 02110-1301, USA.

\n
||msg' | +#fix up screens +perl -p -e 'undef $/;s|\n\n||msg' | +perl -p -e 'undef $/;s|\n\n\n||msg' | +perl -p -e 'undef $/;s|\n\n||msg' | +perl -p -e 'undef $/;s|\n\n\n||msg' | +#fix up index tags +perl -p -e 'undef $/;s|\nIndex\n||msg' | +#needed later, for TABLES! +perl -p -e 'undef $/;s|\n||msg' > clean.xml + +#further fix up headers! +perl -p -i -e 's|<\?latexml searchpaths="[^>]*>\n||g' clean.xml + + +#change main tags +sed -i -e 's/<\/document>/<\/book>/g' clean.xml + +#more fixup for screen tags +perl -p -i -e 's|||g' clean.xml +perl -p -i -e 's|||g' clean.xml + +#clean section tags +sed -i -e 's/
/<\/chapter>/g' clean.xml + +#change subsection and subsubsection tags to section +sed -i -e 's//<\/section>/g' clean.xml +sed -i -e 's//<\/section>/g' clean.xml + +#remove with +sed -i -e 's///g' clean.xml +sed -i -e 's/<\/para>//g' clean.xml +sed -i -e 's/

//g' clean.xml +sed -i -e 's/<\/p>/<\/para>/g' clean.xml + +#properly convert xrefs +sed -i -e 's//indexterm>/g' clean.xml +perl -p -i -e 's///g' clean.xml +sed -i -e 's///g' clean.xml +sed -i -e 's/<\/indexphrase>/<\/primary>/g' clean.xml + +#convert s +sed -i -e 's/emph>/emphasis>/g' clean.xml + +#convert itemizedlists and listitems, dependent on successful exec of "fix up screens" perl routines +sed -i -e 's///g' clean.xml +sed -i -e 's///g' clean.xml +sed -i -e 's/<\/itemize>/<\/itemizedlist>/g' clean.xml +sed -i -e 's/<\/item>/<\/listitem>/g' clean.xml + +#convert orderedlists and their respective listitems +perl -p -i -e 's|||g' clean.xml +perl -p -i -e 's|||g' clean.xml +perl -p -i -e 's|||g' clean.xml + +#TRICKY: this perl expression takes all occurences of +# http://sourceware.org/systemtap/wiki/HomePage +# and replaces the string with "/>". from jfearn +# note: [^"]* means "any number of occurences of characters that are NOT quotes +# note: () groups strings/an expression together, which can be called later as $1 when replacing +perl -p -i -e 's|([^<]*|$1/>|g' clean.xml + +#now, convert s +sed -i -e 's/ accordingly; bold is , typewriter is +perl -p -i -e 's|([^<]*)|$1|g' clean.xml +sed -i -e 's///g' clean.xml +perl -p -i -e 's|([^<]*)|$1|g' clean.xml +sed -i -e 's///g' clean.xml + +#weird remainders, defaulting them to command +perl -p -i -e 's|([^<]*)|$1|g' clean.xml +sed -i -e 's///g' clean.xml +perl -p -i -e 's|([^<]*)|$1|g' clean.xml +sed -i -e 's///g' clean.xml + +#TABLES! +#the first expression is quite dirty, since it assumes that all tables have 3 columns. dunno yet how to +#automagicize this, since the orig XML doesn't have any attribute that specifies columns per table +sed -i -e 's///g' clean.xml +sed -i -e 's/tabular>/tgroup>/g' clean.xml +perl -p -i -e 's|)|
]*>||g' clean.xml +perl -p -i -e 's|]*>||g' clean.xml +perl -p -i -e 's|||g' clean.xml +perl -p -i -e 's|||g' clean.xml +perl -p -i -e 's|||g' clean.xml +perl -p -i -e 's|||g' clean.xml + +#remove "About this guide" section +#perl -p -i -e 'undef $/;s|
\nAbout this guide||msg' clean.xml + +#finalize: copy clean.xml to en-US, then deletes it +cp clean.xml en-US/Language_Reference_Guide.xml + +#delete excess files +rm langref.tex +rm clean.xml +rm Language_Reference_Guide.xml -- cgit