Home | 簡體中文 | 繁體中文 | 雜文 | 知乎專欄 | Github | OSChina 博客 | 雲社區 | 雲棲社區 | Facebook | Linkedin | 視頻教程 | 打賞(Donations) | About
知乎專欄多維度架構 | 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者”

2.8. Apple Mac

安裝 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