+ // in
+ $srcDir = Builder::workspaceDir();
+ // out
+ $docDir = Builder::workspaceDir().'/doc';
+
+ // API docs
+
+ // from phpdoc comments using phpdocumentor
+ $cmd = Builder::tool('php');
+ pake_sh("$cmd " . Builder::toolsDir(). "/vendor/bin/phpdoc run --cache-folder ".Builder::buildDir()."/.phpdoc -d ".$srcDir.'/src'." -t ".$docDir.'/api --title PHP-XMLRPC');
+
+ // from phpdoc comments using Sami
+ // deprecated on 2021/12, as Sami is abandonware
+ /*$samiConfig = <<<EOT
+<?php
+ \$iterator = Symfony\Component\Finder\Finder::create()
+ ->files()
+ ->exclude('debugger')
+ ->exclude('demo')
+ ->exclude('doc')
+ ->exclude('tests')
+ ->in('./build/workspace');
+ return new Sami\Sami(\$iterator, array(
+ 'title' => 'PHP-XMLRPC',
+ 'build_dir' => 'build/workspace/doc/api',
+ 'cache_dir' => 'build/cache',
+ ));
+EOT;
+ file_put_contents('build/sami_config.php', $samiConfig);
+ $cmd = Builder::tool('php');
+ pake_sh("$cmd " . Builder::toolsDir(). "/vendor/bin/sami.php update -vvv build/sami_config.php");*/
+
+ // User Manual
+
+ // html (single file) from asciidoc
+ $cmd = Builder::tool('asciidoctor');
+ pake_sh("$cmd -d book -o $docDir/manual/phpxmlrpc_manual.html $srcDir/doc/manual/phpxmlrpc_manual.adoc");
+
+ // then docbook from asciidoc
+ /// @todo create phpxmlrpc_manual.xml with the good version number
+ /// @todo create phpxmlrpc_manual.xml with the date set to the one of last commit (or today?)
+ pake_sh("$cmd -d book -b docbook -o $docDir/manual/phpxmlrpc_manual.xml $srcDir/doc/manual/phpxmlrpc_manual.adoc");
+
+ # Other tools for docbook...
+ #
+ # jade cmd yet to be rebuilt, starting from xml file and putting output in ./out dir, e.g.
+ # jade -t xml -d custom.dsl xmlrpc_php.xml
+ #
+ # convertdoc command for xmlmind xxe editor
+ # convertdoc docb.toHTML xmlrpc_php.xml -u out
+ #
+ # saxon + xerces xml parser + saxon extensions + xslthl: adds a little syntax highlighting
+ # (bold and italics only, no color) for php source examples...
+ # java \
+ # -classpath c:\programmi\saxon\saxon.jar\;c:\programmi\saxon\xslthl.jar\;c:\programmi\xerces\xercesImpl.jar\;C:\htdocs\xmlrpc_cvs\docbook-xsl\extensions\saxon65.jar \
+ # -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl \
+ # -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl \
+ # -Dxslthl.config=file:///c:/htdocs/xmlrpc_cvs/docbook-xsl/highlighting/xslthl-config.xml \
+ # com.icl.saxon.StyleSheet -o xmlrpc_php.fo.xml xmlrpc_php.xml custom.fo.xsl use.extensions=1
+
+ // HTML (multiple files) from docbook - discontinued, as we use the nicer-looking html gotten from asciidoc
+ /*Builder::applyXslt($docDir.'/manual/phpxmlrpc_manual.xml', $docDir.'/build/custom.xsl', $docDir.'/manual');
+ // post process html files to highlight php code samples
+ foreach(pakeFinder::type('file')->name('*.html')->in($docDir.'/manual') as $file)
+ {
+ file_put_contents($file, Builder::highlightPhpInHtml(file_get_contents($file)));
+ }*/
+
+ // PDF file from docbook
+
+ // convert to fo and then to pdf using apache fop
+ Builder::applyXslt($docDir.'/manual/phpxmlrpc_manual.xml', $docDir.'/build/custom.fo.xsl', $docDir.'/manual/phpxmlrpc_manual.fo.xml');
+ $cmd = Builder::tool('fop');
+ pake_sh("$cmd $docDir/manual/phpxmlrpc_manual.fo.xml $docDir/manual/phpxmlrpc_manual.pdf");
+
+ // cleanup
+ unlink($docDir.'/manual/phpxmlrpc_manual.xml');
+ unlink($docDir.'/manual/phpxmlrpc_manual.fo.xml');