知乎专栏 |
安装 dtd 文件
neo@MacBook-Pro ~ % brew install docbook
安装目录 /usr/local/Cellar/docbook/5.0/docbook/xml/5.0
安装 xsl 文件
neo@MacBook-Pro ~ % brew install docbook-xsl
安装目录/usr/local/Cellar/docbook-xsl/1.79.1/docbook-xsl/
neo@MacBook-Pro /tmp/doc % cat sample.xml <?xml version="1.0" encoding="utf-8"?> <book> <bookinfo> <title>My EPUB book</title> <author><firstname>Liza</firstname> <surname>Daly</surname></author> <volumenum>1234</volumenum> </bookinfo> <preface id="preface"> <title>Title page</title> <figure id="cover-image"> <title>Our EPUB cover image icon</title> <graphic fileref="cover.png"/> </figure> </preface> <chapter id="chapter1"> <title>This is a pretty simple DocBook example</title> <para> Not much to see here. </para> </chapter> <chapter id="end-notes"> <title>End notes</title> <para> This space intentionally left blank. </para> </chapter> </book>
neo@MacBook-Pro /tmp/doc % xsltproc /usr/local/Cellar/docbook-xsl/1.79.1/docbook-xsl/html/chunk.xsl sample.xml Writing pr01.html for preface(preface) Writing ch01.html for chapter(chapter1) Writing ch02.html for chapter(end-notes) Writing index.html for book neo@MacBook-Pro /tmp/doc % ll total 40 -rw-r--r-- 1 neo wheel 1.6K Sep 28 16:51 ch01.html -rw-r--r-- 1 neo wheel 1.5K Sep 28 16:51 ch02.html -rw-r--r-- 1 neo wheel 1.8K Sep 28 16:51 index.html -rw-r--r-- 1 neo wheel 1.8K Sep 28 16:51 pr01.html -rw-r--r-- 1 neo wheel 710B Sep 28 16:51 sample.xml