【问题】
docbook已经折腾了不少东西了,但是都在忙pdf方面的。
现在开始回来折腾HTML方面的。
对于默认输出的HTML,之前看到的解释,应该就是多个HTML才对。
然后对应的单个HTML是XHTML才对。
但是结果,我这默认输出的HTML是单个的文件:MPEG_VBR.html。效果如下:
现在想要让其输出为多个HTML的那种效果。
【解决过程】
1.参考官网的解释:Chunking into multiple HTML files,去更改了对应配置。
先是参照原先的html的配置,自己写了个配置文件chunk_crl.xsl:
<?xml version='1.0'?> <!DOCTYPE stylesheet [ <!ENTITY xsl_ns_base_dir "/home/CLi/develop/docbook/tools/docbook-xsl-ns-1.76.1"> <!-- <!ENTITY xsl_ns_base_dir "/cygdrive/e/Dev_Root/docbook/tools/docbook-xsl-ns-1.76.1"> --> ] > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> <xsl:import href="&xsl_ns_base_dir;/html/chunk.xsl"/> <xsl:output method="html" encoding="UTF-8" indent="no"/> <xsl:param name="title.font.family">msyhbd</xsl:param> <xsl:param name="body.font.family">msyh</xsl:param> <xsl:param name="monospace.font.family">msyh</xsl:param> <!--============================================================================ misc setting =============================================================================--> <xsl:param name="section.autolabel" select="1"/> <xsl:param name="section.label.includes.component.label" select="1"/> <xsl:param name="bibliography.numbered" select="1"/> </xsl:stylesheet>
然后再去试试,结果就可以生成了:
CLi@PC-CLI-1 ~/develop/docbook/books/VBR/VBR/src $ XML_CATALOG_FILES="/home/CLi/develop/docbook/config/catalog/catalog.xml" \ > xsltproc.exe --xinclude -o ../output/html/multi/MPEG_VBR.html chunk_html_crl.xsl MPEG_VBR.xml Writing pr01s02.html for section Writing pr01.html for preface(preface) Writing ch01s02.html for sect1 Writing ch01s03.html for sect1 Writing ch01s04.html for sect1 Writing ch01s05.html for sect1 Writing ch01.html for chapter(ch1_mpeg_related) Writing ch02s02.html for sect1 Writing ch02s03.html for sect1 Writing ch02s04.html for sect1 Writing ch02s05.html for sect1 Writing ch02s06.html for sect1 Writing ch02s07.html for sect1 Writing ch02s08.html for sect1 Writing ch02.html for chapter(ch2_mp3_term.xml) Writing ch03s02.html for sect1 Writing ch03s03.html for sect1 Writing ch03.html for chapter(ch3_mpeg_frame.xml) Writing ch04s02.html for sect1 Writing ch04.html for chapter(ch4_xing_vbri.xml) Writing ch05s02.html for sect1 Writing ch05s03.html for sect1 Writing ch05.html for chapter(ch5_calc_duration.xml) Writing ch06s02.html for sect1 Writing ch06s03.html for sect1 Writing ch06s04.html for sect1 Writing ch06.html for chapter(ch6_mp3_related.xml) Writing ch07.html for chapter(ch7_after_content.xml) Writing bi01.html for bibliography(reference) Writing index.html for book
对应的效果如下:
然后打开index.html后, 点击下一页,也是正常的:
【总结】
想要生成多个html文件,主要是把默认的html的docbook.xsl换为chunk.xsl即可。