This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] Including raw HTML (highlighted code)


Hi,
I use this process for function description.
DocBook solves for mi documentation, "PHP Beautifier (http://www.beautifier.org)" examples in programlisting.


1. DocBook generate *.HTML output, where programlisting can contain PHP script for highlighted example. Page generated from DocBook have name of the function (FunctionNamePage.HTML).
2. All generated HTMLs are processed by PHP. Source of the examples are in their native form! They are converted to html, highlighted and names of the functions are changed to hyperlink pointing to FunctionNamePage.HTML!!!
3. Result I compile to HtmlHelp


All is processed by batch and works well.

-------------
Code DocBook XML

<programlisting>
<?hhlp_php name="MyFunction.FMG"?>
</programlisting>

-------------
In XSL customization layer

<xsl:template match="processing-instruction('hhlp_php')">
 <xsl:variable name="name">
   <xsl:call-template name="pi-attribute">
     <xsl:with-param name="pis"
                     select="."/>
     <xsl:with-param name="attribute" select="'name'"/>
   </xsl:call-template>
 </xsl:variable>

<xsl:processing-instruction name="php">
$BEAUT_PATH = "Z:/db/bin/php/Beautifier";
include_once "$BEAUT_PATH/Beautifier/Init.php";
include_once "$BEAUT_PATH/HFile/HFile_FMTFMG.php";
include_once "$BEAUT_PATH/Output/Output_css.php";
$highlighter = new Core(new HFile_FMTFMG(), new Output_css());
print $highlighter->highlight_text($highlighter->load_file("Z:/doc/_htmlE/<xsl:value-of select="$name"/>"));
?</xsl:processing-instruction>
</xsl:template>
--------------


Mila

_________________________________________________________________
Chatujte bezpecne s lidmi, ktere si umistite na seznam svych pratel - stahujte MSN Messenger 6.1! http://www.msn.cz/procmessenger



To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]