Docbook conversion - I could use some help.
| From: | Brett Bieber | Date: | Sat, 12 Jan 2008 05:12:01 +0000 |
| Subject: | Docbook conversion - I could use some help. | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-10363@lists.php.net to get a copy of this message | ||
Ok folks... this is where I'm at with the peardoc conversion.
I've got a simple script which will run through the files, convert to
docbook 5 the files it can, and return a list of any files with
errors. The files with errors need to be fixed (with the exception of
1 type of error). When I last checked, there were 207 files with
errors. I've fixed all but 5 in /en/, and the rest are in the various
translations.
The latest script is available here... yeah yeah, I'm not using CVS:
http://wiki.pear.php.net/index.php/PEARDocMoveToDocbook5#Conversion_Script
There is a little preparation work to run the script: you'll need all
the tools to build the current documentation, the cloak perl script,
the db4-upgrade.xsl file and PHP 5.
At the top of the conversion script there are 3 or four commands you
can use to grab the necessary files. The script expects to run from a
directory with a checkout of peardoc located in ./peardoc/
Filesystem layout like this:
./peardoc_conversion.sh
./cloak
./uncloak
./db4-upgrade.xsl
./peardoc/{CVS CHECKOUT IN HERE}
./peardoc_new/{This is where the docbook5 converted files will go}
I have the file named peardoc_conversion.sh and run it with
$> ./peardoc_conversion.sh
(If you want to focus on your translation, just modify the foreach
$lang array to only check your language.)
When the script finishes, you should get a list of files with problems.
To find out what the problem is with each individual file, you can run
the conversion on that specific file to see the error:
$> ./peardoc_conversion.sh peardoc/de/chapters/faq/users.xml
With this you can fix the individual files and test the conversion
without converting all of peardoc.
There are 3 likely errors:
1. <!DOCTYPE declaration within a CDATA section --- easy to handle,
there are 5 in /en/ right now.
2. File does not have a root node (&package.blah.blah; entity placed
outside of a </refentry> section)... /en/ has all these fixed now.
3. Encoding problems for example:
"peardoc/de/chapters/faq/users.xml.cloak:30: parser error : Input is
not proper UTF-8, indicate encoding !"
The <!DOCTYPE problems are fine... we can handle these. The XML files
that don't have root notes are a problem - syncing with en should fix
all of these, and the encoding errors need to be corrected. Once we
have the list of problem files solved, I think we're ready to move to
docbook 5.
A couple notes --- it appears our CDATA sections are going to get
converted into entities with no CDATA separation - if this is a
problem then we can try and preserve all the CDATA sections with some
tricks.
That's the latest update from me... I'll continue to battle this out,
but it should be fairly easy for another person to jump in and help
tackle some of these issues... which I would appreciate. I'm not
asking (or ready) to commit any changes or start a new branch, this is
just necessary prep work to get peardoc into shape so we can start
testing out a new build process with PhD.
--
-Brett Bieber
http://saltybeagle.com/