+ $docDir = Builder::workspaceDir().'/doc';
+
+ // API docs
+
+ // from phpdoc comments using phpdocumentor
+ $cmd = Builder::tool('php');
+ pake_sh("$cmd vendor/phpdocumentor/phpdocumentor/bin/phpdoc run -d ".Builder::workspaceDir().'/src'." -t ".Builder::workspaceDir().'/doc/api --title PHP-XMLRPC');
+
+ // User Manual
+
+ // html (single file) from asciidoc
+ $cmd = Builder::tool('asciidoctor');
+ pake_sh("$cmd -d book $docDir/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 $docDir/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 highligting
+ # (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');