Pro PHP- Patterns, Frameworks, Testing and More

(vip2019) #1

(^66) CHAPTER 6 ■ DOCUMENTATION AND CODING CONVENTIONS
If all went well, you should get this result:
Writing mychapter.html for chapter(mychapter)
Writing index.html for book(mybook)
You will notice that two files were created: an index document for the book and mychapter.
html for the chapter. The index.html document will have links to the mychapter.html file
automatically.
Now, you might be thinking that your DocBook file could get really large, and you would
be right. Fortunately, DocBook supports linking XML files together by modifying the DOCTYPE
with an ENTITY tag. Once the entity exists, you may use the &entity syntax to specify where to
import the entity’s data. Inclusion of external files is demonstrated in Listing 6-6.
Listing 6-6. DocBook File with an Included Chapter
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"/usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
[
<!ENTITY chapter1 SYSTEM "chapter1.xml">
]>




Documentation
Cool Application

&chapter1;

Next, create a file named chapter1.xml, adding the content presented in Listing 6-7.
Listing 6-7. A DocBook Chapter in an External File

Chapter Title

Section Title
Introduction to this section

Sections may have subsections



McArthur_819-9C06.fm Page 66 Friday, February 22, 2008 8:59 AM
Free download pdf