diff --git a/doc/msxsl_build.bat b/doc/msxsl_build.bat index ca82add..5f87822 100755 --- a/doc/msxsl_build.bat +++ b/doc/msxsl_build.bat @@ -1,11 +1,14 @@ @echo off -if "%4" == "" goto build -f:\msxsl\msxsl.exe f:\home\depot\xml\stylesheets\docbook-xsl-1.50.0\html\titlepage.templates.xml f:\home\depot\xml\stylesheets\docbook-xsl-1.52.2\template\titlepage.xsl | f:\msxsl\msxsl.exe - f:\msxsl\to_utf8.xsl -o f:\home\depot\xml\stylesheets\docbook-1.50.0\html\titlepage.templates.xsl +if "%3" == "" goto usage -:build -sx -x lower -x empty %2 >%3.xml -f:\msxsl\msxsl.exe %3.xml f:\home\depot\xml\stylesheets\docbook-xsl-1.50.0\html\my\%1 -o %3 +c:\home\sx\bin\sx -x lower -x empty %2 >%3.xml +c:\home\msxsl\msxsl.exe %3.xml ..\..\..\..\..\docbook-xsl-1.50.0\html\my\%1 -o %3 del %3.xml -f:\tidy\tidy.exe -config f:\tidy\config.txt -m %3 -f:\tidy\tidy_attr.py %3 +c:\home\tidy\tidy.exe -config tidy_config -m %3 +python tidy_attr.py %3 +exit + +:usage +echo Usage example: +echo msxsl_build.bat docbook_msxsl.xsl src\body.sgml index.html diff --git a/doc/paper/msxsl_build.bat b/doc/paper/msxsl_build.bat deleted file mode 100755 index ca82add..0000000 --- a/doc/paper/msxsl_build.bat +++ /dev/null @@ -1,11 +0,0 @@ -@echo off - -if "%4" == "" goto build -f:\msxsl\msxsl.exe f:\home\depot\xml\stylesheets\docbook-xsl-1.50.0\html\titlepage.templates.xml f:\home\depot\xml\stylesheets\docbook-xsl-1.52.2\template\titlepage.xsl | f:\msxsl\msxsl.exe - f:\msxsl\to_utf8.xsl -o f:\home\depot\xml\stylesheets\docbook-1.50.0\html\titlepage.templates.xsl - -:build -sx -x lower -x empty %2 >%3.xml -f:\msxsl\msxsl.exe %3.xml f:\home\depot\xml\stylesheets\docbook-xsl-1.50.0\html\my\%1 -o %3 -del %3.xml -f:\tidy\tidy.exe -config f:\tidy\config.txt -m %3 -f:\tidy\tidy_attr.py %3 diff --git a/doc/readme b/doc/readme new file mode 100644 index 0000000..a73b439 --- /dev/null +++ b/doc/readme @@ -0,0 +1,18 @@ + +To re-generate the docs in the exact format as they appear here, you would +need a slightly tweaked DocBook XSLT stylesheets disrtibution available at +http://www.mywikinet.com/mpl/docbook-xsl-1.50.0.zip + +If you are to use the build scripts as-is, you also need these tools: + + sx - an SGML to XML convertor, a part of James Clark's SP package, + available at http://www.jclark.com/sp/ + + msxsl - Microsoft XSLT processor, available at + http://msdn.microsoft.com/library/en-us/dnxml/html/msxsl.asp + + tidy - http://tidy.sourceforge.net/ + + Python - to be able to run 'tidy_attr.py', + available at http://www.python.org or + http://www.activestate.com/Products/ActivePython/ diff --git a/doc/tidy_attr.py b/doc/tidy_attr.py new file mode 100644 index 0000000..d5f3de8 --- /dev/null +++ b/doc/tidy_attr.py @@ -0,0 +1,28 @@ +import re +import sys +import os +import string + +def tidy_attr(attr_value): + return string.lower(attr_value.group()) + +def tidy(file): + lines = open(file, 'r').readlines() + regex = re.compile(r'[name|class]="([^"]*)"') + xsltproc_patch = re.compile(r'(\|\|\|)') + for i in range(len(lines)): + lines[i] = regex.sub(tidy_attr,lines[i]) + lines[i] = xsltproc_patch.sub(' ',lines[i]) + + open(file, 'w') \ + .writelines(lines) + +def main(): + if len(sys.argv) < 2: + print '\tusage: %s ' % sys.argv[0] + return -1 + + tidy(sys.argv[1]) + print 'done!' + +main() diff --git a/doc/tidy_config b/doc/tidy_config new file mode 100644 index 0000000..7bdc71d --- /dev/null +++ b/doc/tidy_config @@ -0,0 +1,7 @@ +doctype: loose +tidy-mark: no +wrap: 0 +wrap-attributes: no +enclose-text: yes +drop-empty-paras: no +quiet: yes