DocBook: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
Line 108: Line 108:
The most popular and semi-official stylesheet was mostly written by Norman Walsh and is available for free through sourceforge as [http://wiki.docbook.org/topic/DocBookXslStylesheets explained in the DocBook Wiki]
The most popular and semi-official stylesheet was mostly written by Norman Walsh and is available for free through sourceforge as [http://wiki.docbook.org/topic/DocBookXslStylesheets explained in the DocBook Wiki]


This DocBook XML Publishing XSLT stylewheet can produce HTML, Chunked HTML, PDF and PostScript as shown in the following figure.
This DocBook XML Publishing XSLT stylewheet can produce HTML, Chunked HTML, PDF and PostScript as shown in the following figure.  
 
[[image:xmlpubxslt.png|frame|none|Copyright: [http://nwalsh.com/docbook/procdiagram/index.html Norman Walsh], reproduced without permission]]


In addition, a new tool called [http://sourceforge.net/projects/db-xsl-cfg/ DocBook XSL Configurator] contains three Java (Swing) applications used to create DocBook XSL customization layers (FO, HTML, and Manpages) and then execute external subprocesses to transform DocBook XML and view the output (not tested, alpha in 2008).


It also is possible to import Docbook into some word processors, e.g. FrameMaker or OpenOffice.
It also is possible to import Docbook into some word processors, e.g. FrameMaker or OpenOffice.

Revision as of 17:46, 1 November 2010

Draft

Definition

DocBook is a XML-based document standard popular for writing large documentation. This structured authoring standard was originally created by software companies to support writing of technical documentation. However, since then, it has been adapted to many purposes.

The principle

“The core DocBook standard is the DocBook Document Type Definition (DTD) maintained by the DocBook Technical Committee in OASIS. The DTD defines the vocabulary of content elements that an author can use and how they relate to each other. For example, a book element can contain a title element, any number of para elements for paragraphs, and any number of chapter elements. Using the DTD and XML syntax, authors mark up their text content with tag names enclosed in angle brackets like <chapter>. The markup is similar to HTML, but with more tags and tighter rule” (DocBook XSL: The Complete Guide], retrieved 22:26, 4 June 2007 (MEST).

Docbook is interesting if you have:

  • Large quantities of content.
  • Structured content.
  • Content that needs to be interchanged among otherwise incompatible systems.
  • Content that you also want to process with a computer
  • Content to be rendered in multiple output forms and versions (HTML, PDF, PS, ...)

One can author docbook with any XML editor (see WYSIWYM), but there exist also near or full WYSIWYG solutions, e.g. FrameMaker.

DocBook can be customized to fit specific user's needs (requires the expertise of an information architect).

In education

Docbook is also used in education, e.g.

  • To write documentation and manuals, e.g. the schoolbus Project
  • To write course materials, e.g. in the Edukalibre project.

An example

The following code are bits from FOSS Government and Policy Primer (docbook xml)

<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<book>
  title>Free/Open Source Software: Government Policy</title>
  <bookinfo>
    <publisher>
      <publishername>International Open Source Network</publishername>
    </publisher>
    <authorgroup>
      <author>
	<firstname>Kenneth</firstname>
	<surname>Wong</surname>
      </author>
    </authorgroup>
  </bookinfo>
  <preface>
    <title>FOREWORD</title>
    <para>Free software means software that respects the user's
    freedom. It means that users are free to run the programs as they
    wish, free to study and change the software (or hire others to do
    it for them), free to redistribute copies to others, and free to
    publish modified versions. As a consequence, users are free to
    share, and form communities to exercise effective control over the
    software they use. Free software may also be gratis, zero price,
    but this is not always the case.</para>
    [.....]
    <para>Richard M. Stallman</para>
  </preface>
  <preface>
    <title>PREFACE</title>
    <para>Free and Open Source Software (FOSS) has grown incredibly in
    the past few years. Once considered a hobbyist's toy, FOSS has
    grown by leaps and bounds and is now used widely throughout the
    world, even in critical environments such as financial systems and
    network backbones.</para>

    [ ....]

  </preface>
  [ ....]
  <chapter>
    <title>Introduction</title>
    <blockquote>
      <attribution>David Wheeler</attribution>

      <para>Briefly, OSS/FS programs are programs whose licenses give
      users the freedom to run the program for any purpose, to study
      and modify the program, and to redistribute copies of either the
      original or modified program (without having to pay royalties to
      previous developers).

     <footnote>
	<para>Wheeler, David, "Why OSS/FS? Look at the Numbers!" [home
	page online]; available from <ulink
	url="http://www.dwheeler.com/oss_fs_why.html">
             http://www.dwheeler.com/oss_fs_why.html</ulink>;
	Internet; accessed on November 7, 2003.</para>
	</footnote>
       </para>
    </blockquote>

    <para>The above quotation summarizes the guiding principles of
    FOSS - the freedom to use, understand, modify and distribute
    software. Seemingly a simple matter, today, these principles can
    have a profound impact on the economics and dynamics of the
    software industry.</para> [.... ]
  </chapter>
  [.....]
</book

On the internal open source network web site, you can see various rendering, e.g. as wikibook, or PDF or OpenOffice

Styling docbook

Typically, informal docbook publications are style with an XSLT stylesheet. The most popular and semi-official stylesheet was mostly written by Norman Walsh and is available for free through sourceforge as explained in the DocBook Wiki

This DocBook XML Publishing XSLT stylewheet can produce HTML, Chunked HTML, PDF and PostScript as shown in the following figure.

Copyright: Norman Walsh, reproduced without permission

In addition, a new tool called DocBook XSL Configurator contains three Java (Swing) applications used to create DocBook XSL customization layers (FO, HTML, and Manpages) and then execute external subprocesses to transform DocBook XML and view the output (not tested, alpha in 2008).

It also is possible to import Docbook into some word processors, e.g. FrameMaker or OpenOffice.

Below we show a screen capture that shows the title page, automatically generated table of contents and the first page of the FOSS example shown above.

Screenshot of an Open Office document inititally produced with DocBook

Links

DocBook Schemas

Docbook schemas are available in several languages including RELAX NG, SGML and XML DTDs, and W3C XML Schema.

  • DocBook. The official home page for DocBook: The Definitive Guide. Includes downloads for various variants.

Manuals

  • The DocBook Wiki Contains most everything to start (Tutorials, Books, Documentation, Software, ...)!
  • DocBook 3: The Definitive Guide (1999) ISBN 1-56592-580-7. This is free on-line O'Reilly book for the SGML version of DocBook, but most organizations now use a more recent XML version of DocBook (see next item).
  • Walsh, Norman and Hamilton, Richard (2010). DocBook 5: The Definitive Guide, O'Reilly, ISBN 0-596-80502-0. DocBook is the current standard as of 2010.

XSLT

Tutorials

Software

Any good XML editor (structure or wysiwyg editor) can be used to edit DocBook. Some vendors already include schemas and Stylesheet.

Other

  • DocBook page by Norman Walsh. Norman is one of the major XML players and contributed a lot to DocBook (e.g. he is chair of the DocBook technical committee, wrote most of the XSLT stylesheet, co-author of the DocBook: The Definitive Guide...).
  • RefDB, RefDB is a reference database and bibliography tool for DocBook SGML/XML documents. It allows users to share databases over a network. Finally something like this is emerging :) 6/2001
  • JReferences, is a tool to store and retrieve bibliographic references from a file or MySQL database. It reads BibTeXML, DocBook XML and RIS type references, and can output these and BibTex. A bibtex like alternative is also provided for DocBook. See BibTexML for details about the BibTexML standard and other tools

Links of links