X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=scripts%2Fdiogenes-importpod.php;fp=scripts%2Fdiogenes-importpod.php;h=0000000000000000000000000000000000000000;hb=66a0db100b8c65b7d85255cee529cbf7c3333324;hp=678efe820d7766534b15be1a4442a2e1427605ba;hpb=7d7400eafcf18fddfd6df14b7d0a3a1700455ea7;p=diogenes.git diff --git a/scripts/diogenes-importpod.php b/scripts/diogenes-importpod.php deleted file mode 100755 index 678efe8..0000000 --- a/scripts/diogenes-importpod.php +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/php -barrel; - - $pid = $barrel->makePath($docdir, $caller); - $page = Diogenes_Barrel_Page::fromDb($barrel, $pid); - if (!$page->props['PID']) { - echo "failed to get Page $pid\n"; - exit(1); - } - - # produce HTML from POD - $pod = realpath($pod); - if (($tmpdir = System::mktemp('-d')) == false) { - $this->kill("Error : could not create temporary directory!"); - } - $content = shell_exec("cd $tmpdir && pod2html --htmlroot=FOODOCBASE --infile=".escapeshellarg($pod)); - $content = str_replace('
', '', $content); - $content = preg_replace('/FOODOCBASE(.*).html/', "/$docbase$1/", $content); - - # extract title - if (preg_match("/(.*)<\/title>/si", $content, $matches)) - { - $page->props['title'] = addslashes($matches[1]); - if ($template) - $page->props['template'] = $template; - $page->toDb(0, $caller); - } - - # strip un-needed info - $rcs = $caller->getRcs(); - $content = $rcs->importHtmlString($content); - if (preg_match("/<h1><a name=\"synopsis\">.*/si", $content, $matches)) - $content = $matches[0]; - - $content = str_replace("h1>", "h2>", $content); - $rcs->commit($pid,$globals->htmlfile,$content,"automatic import"); -} - - -/** Import a set of Perl POD files. - * - * @param $caller - * @param $docarray - * @param $docbase - * @param $template - */ -function importPods(&$caller, $docarray, $docbase, $template = '') -{ - foreach ($docarray as $pod => $docdir) - { - importPod($caller, $pod, $docdir, $docbase, $template); - } -} - - -/** Print program usage and exit. - */ -function usage() -{ - echo "Usage : pod2diogenes.php - exit(1); -} - - -function main() -{ - $alias = "umts_tools"; - $script = new Diogenes_Script($alias, "sharky"); - $podmap = array(); - importPods($script, $docs, "docs", "barrel:pod.tpl"); -} - -main(); -?>