知乎專欄 | 多維度架構 | | | 微信號 netkiller-ebook | | | QQ群:128659835 請註明“讀者” |
我們把docbook文檔轉換成html文檔時,可以轉換成一個大的html文檔,也可以轉換成多頁的html文檔。當轉換成多頁是,預設的檔案是以ch01.html、ch02.html方式命名的,較不直觀。我們可在docbook文檔中添加一個屬性,使它輸出時按我們指定的檔案名輸出。 方法一: <chapter><?dbhtml filename="first.html" ?> <title>Introduction</title> ...
方法二: <chapter id="first"> <title>Introduction</title> ... xsltproc --stringparam use.id.as.filename 1 chunk.xsl myfile.xml
預設轉換後的文檔是保存在當前目錄的,我們可在xsltproc命令行用-o選項指定轉換後文檔的輸出路徑,另外一種是在docbook中指定。 <book><?dbhtml dir="neo" ?> <title>Docbook Guide</title> ... <chapter id="first"><?dbhtml dir="technic" ?> ... <chapter id="second"> ... <appendix id="three"><?dbhtml dir="read" ?> ... 輸出後的路徑: jims/index.html jims/technic/first.html jims/second.html jims/read/three.html
... </para> <?dbhtml-include href="mycode.html"?> <?dbhtml-include href="../additonal.html"?> <para> ...
<xsl:template name="user.header.content"> <xsl:variable name="codefile" select="document('mycode.html',/)"/> <xsl:copy-of select="$codefile/htmlcode/node()"/> </xsl:template>
admon.graphics 1
xsltproc --stringparam admon.graphics 1 docbook.xsl myfile.xml
If you use callout graphics, then there are three parameters that give you more control over the generated img tag. callout.graphics.extension Use this parameter to change the icon file extension from .png to something else. Of course, you must have the graphics that match that extension. callout.graphics.path Use this parameter to change the generated directory name from the default images/callouts/. Be sure to include the trailing slash. callout.graphics.number.limit Use this parameter to set the highest number for which you have a callout graphic. The stylesheets are distributed with callout graphics files with numbers up to 15, but you could create graphics with additional numbers if you need them. If you have more numbers but you do not reset this parameter, then any numbers over 15 will still format like (16).
包含html檔案到當前頁面
<?dbhtml-include href="file:///www/freebsd/faq.html"?> <?dbhtml-include href="http://www.example.org/freebsd/faq.html"?>
注意:需要開啟下面兩個選項才能生效
<xsl:param name="use.extensions" select="1"/> <xsl:param name="textinsert.extension" select="1"/>