DocBook

来自开放百科 - 灰狐
2010年8月16日 (一) 05:21Allen (讨论 | 贡献)的版本

跳转到: 导航, 搜索

DocBook is an XML vocabulary that lets you create documents in a presentation-neutral form that captures the logical structure of your content. Using free tools along with the DocBook XSL stylesheets, you can publish your content as HTML pages and PDF files, and in many other formats.

Install

Structure of the DocBook DTD

Debian

#apt-get install xsltproc //XSLT command line processor
#apt-get install rxp // A validating XML parser
#apt-get install docbook
#apt-get install docbook-utils - Convert Docbook files to other formats (HTML, RTF, PS, man, PDF)
#apt-get install docbook-xsl - stylesheets for processing DocBook XML files to various output formats
#apt-get install sgmltools-lite - convert DocBook SGML source into HTML using DSSSL

相关包

docbook-defguide - DocBook: The Definitive Guide - HTML version
docbook-doc - Documentation for the DocBook DTD.
docbook-dsssl - modular DocBook DSSSL stylesheets, for print and HTML
docbook-dsssl-doc - documentation for the DocBook DSSSL stylesheets
docbook-ebnf - EBNF module for the XML version of the DocBook DTD
docbook-html-forms - Extension to DocBook XML for generating html forms
docbook-jrefentry - DocBook XML JRefEntry DTD
docbook-mathml - Extension to DocBook XML for using MathML markup
docbook-simple - Simplified DocBook XML Doctype and css stylesheets.
docbook-slides - XML Slides DTD and XSL Stylesheets
docbook-slides-demo - Demo presentation slides for the docbook-slides package
docbook-to-man - converter from DocBook SGML into roff man macros
docbook-website - XML Website DTD and XSL Stylesheets
docbook-xml - standard XML documentation system, for software and systems
docbook-xsl-stylesheets-ko - Stylesheets for processing DocBook XML files to HTML and FO in korean.
docbook2x - Converts DocBook/XML  documents into man pages and TeXinfo
doclifter - Convert troff to DocBook

相关下载:http://sourceforge.net/projects/docbook/

Examples

http://www.w3.org/XML/Binary/2005/03/test-data/Docbook/examples/

xsltproc docbook-xsl-1.72.0/html/docbook.xsl mybook.xml > mybook.html
xsltproc docbook-xsl-1.72.0/html/docbook.xsl mybook.xml > mybook.pdf
xsltproc docbook-xsl-1.72.0/html/docbook.xsl mybook.xml > mybook.ps
xsltproc docbook-xsl-1.72.0/html/docbook.xsl mybook.xml > mybook.rtf

利用样式表生成单页的html文档,生成文档名为debian.html,生成的文档位于当前目录。

$ xsltproc --stringparam html.stylesheet docbook.css /usr/share/sgml/docbook/docbook-xsl-1.65.1/html/docbook.xsl
debian.xml>debian.html

利用样式表生成多页的html文档,每章和每小节都会生成独立的一个html文档,生成文档位于当前目录。

$ xsltproc --stringparam html.stylesheet docbook.css /usr/share/sgml/docbook/docbook-xsl-1.65.1/html/chunk.xsl debian.xml

用-o选项可指定生成文档的路径

Links

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱