[doc] Some quick docutils runs

Chuck Hagenbuch chuck at horde.org
Fri Jun 13 18:50:55 PDT 2003


Here are the results of running docutils (html.py) on */docs/* :

http://marina.horde.org/wip/hordedocs/

Lots of errors and roughness, but some things - INSTALL, especially - parse
really well. CHANGES, not so well. :)

Here's the script I whipped up to do it: (I have some python issues, which
is why the python2.2 hardcoding)

#!/usr/local/bin/php
<?php

error_reporting(E_ALL);

$DOCUTIL = 'python2.2 /usr/local/src/docutils/tools/html.py';
$HORDE = '/var/www/horde';
$OUTDIR = '/var/www/wip/hordedocs';

exec('ls -1 -I CVS ' . $HORDE . '/docs', $hordefiles);
exec('ls -1 -I CVS ' . $HORDE . '/*/docs', $appfiles);

@mkdir($OUTDIR);

$curdir = $OUTDIR . DIRECTORY_SEPARATOR . 'horde';
@mkdir($curdir);
foreach ($hordefiles as $file) {
    if (!empty($file)) {
        system($DOCUTIL . ' ' . $HORDE . '/docs/' . $file . ' ' . $curdir .
DIRECTORY_SEPARATOR . $file . '.html');
    }
}

$new = true;
foreach ($appfiles as $file) {
    if (empty($file)) {
        $new = true;
        continue;
    }

    if ($new) {
        $sourcedir = substr($file, 0, -1);
        $curdir = str_replace('/docs', '', $sourcedir);
        $curdir = str_replace($HORDE, $OUTDIR, $curdir);
        @mkdir($curdir);

        $new = false;
        continue;
    }

    system($DOCUTIL . ' ' . $sourcedir . '/' . $file . ' ' . $curdir .
DIRECTORY_SEPARATOR . $file . '.html');
}

-chuck

--
Charles Hagenbuch, <chuck at horde.org>
The alligators were there, too, in a bathtub inside the house.



More information about the doc mailing list