Copyright © 1998-2009 DocEng
Copyright
Redistribution and use in source (XML DocBook) and 'compiled' forms (XML, HTML, PDF, PostScript, RTF and so forth) with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code (XML DocBook) must retain the above copyright notice, this list of conditions and the following disclaimer as the first lines of this file unmodified.
Redistributions in compiled form (transformed to other DTDs, converted to PDF, PostScript, RTF and other formats) must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION PROJECT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD DOCUMENTATION PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Thank you for becoming a part of the FreeBSD Documentation Project. Your contribution is extremely valuable.
This primer covers everything you will need to know in order to start contributing to the FreeBSD Documentation Project, from the tools and software you will be using (both mandatory and recommended) to the philosophy behind the Documentation Project.
This document is a work in progress, and is not complete.
Sections that are known to be incomplete are indicated with a
* in their name.
em.profile, for sh(1) and
bash(1) Users.cshrc, for csh(1) and
tcsh(1) UsersCDATA Marked
SectionINCLUDE and
IGNORE in Marked Sectionsh1, h2,
and Other Header Tagshn
Elementspblockquoteul and
oldlpretablerowspancolspanrowspan and
colspan Togetherem and
strongtt<a href="..."><a id="...">book with
bookinfoarticle with
articleinfoparablockquotewarningitemizedlist,
orderedlist, and
procedureprogramlistingco and
calloutlistinformaltableframe="none"screen, prompt,
and userinputemphasisfilenamefilename Tag with
package Roledevicenamehostid and Rolesusernamemaketarget and
makevarliteralreplaceableerrornameid on Chapters and
SectionsanchorxreflinkulinkbookarticleThe following table shows the default system prompt and superuser prompt. The examples will use this prompt to indicate which user you should be running the example as.
| User | Prompt |
|---|---|
| Normal user | % |
root | # |
The following table describes the typographic conventions used in this book.
| Meaning | Examples |
|---|---|
| The names of commands. | Use ls -l to list all
files. |
| The names of files. | Edit .login. |
| On screen computer output. | You have mail. |
| What you type, when contrasted with on-screen computer output. | % su
Password: |
| Manual page references. | Use su(1) to change user names. |
| User and group names | Only root can do
this. |
| Emphasis | You must do this. |
| Command line variables; replace with the real name or variable. | To delete a file, type rm
|
| Environment variables | $HOME is your home
directory. |
Within the text appear notes, warnings, and examples.
Notes are represented like this, and contain information that you should take note of, as it may affect what you do.
Tips are represented like this, and contain information that you might find useful, or lead to an easier way to do something.
Important information is represented like this. Typically they flag extra steps you may need to carry out.
Warnings are represented like this, and contain information warning you about possible damage if you do not follow the instructions. This damage may be physical, to your hardware or to you, or it may be non-physical, such as the inadvertent deletion of important files.
Examples are represented like this, and typically contain examples you should walk through, or show you what the results of a particular action should be.
Welcome to the FreeBSD Documentation Project (FDP). Quality documentation is very important to the success of FreeBSD. Your contributions are very valuable.
This document's main purpose is to explain how the FDP is organized, how to write and submit documentation, and how to effectively use the available tools.
Everyone is welcome to contribute to the FDP. There is no membership requirement or minimum quota of documentation that needs to be produced.
After you have finished reading this document you will be able to:
Identify which parts of FreeBSD are maintained by the FDP.
Install the required tools and files.
Make changes to the documentation.
Submit changes back for review and eventual inclusion in the FreeBSD documentation.
The FDP is responsible for four categories of FreeBSD documentation.
Handbook: The Handbook is the comprehensive online resource and reference for FreeBSD users.
FAQ: The FAQ uses a short question and answer format to address questions that are frequently asked on the various mailing lists and forums devoted to FreeBSD. This format does not permit long and comprehensive answers.
Manual pages: The English language system manual pages are usually not written by the FDP, as they are part of the base system. However, the FDP can reword parts of existing manual pages to make them clearer or to correct inaccuracies.
Web site: This is the main FreeBSD presence on the web, visible at http://www.FreeBSD.org/ and many mirrors around the world. The web site is typically a new user's first exposure to FreeBSD.
Translation teams are responsible for translating the Handbook and web site into different languages. Manual pages are not translated.
Documentation source for the FreeBSD web site, Handbook, and
FAQ is available in the Subversion
repository at
https://svn.FreeBSD.org/doc/.
Source for manual pages is available in a separate
Subversion repository located at
https://svn.FreeBSD.org/base/.
The commit messages to the FDP are visible to anyone usingvsvn. They are also archived at http://lists.FreeBSD.org/mailman/listinfo/svn-doc-all.
In addition, many people have written tutorials or how-to articles about FreeBSD. Some are stored in the FDP. In other cases, the author has decided to keep the documentation separate from the FDP. The FDP endeavors to provide links to as much of this documentation as possible.
This section outlines the steps which new contributors need to follow before they can make changes to the FDP. New contributors will interact with other members of the FreeBSD Documentation Team which can assist in learning how to use XML and the Section 10.1, “Style Guide”. If a new user contributes regularly, a Documentation Team member may be assigned as a mentor to guide the user through the process from contributor to documentation committer.
Subscribe to the FreeBSD documentation project mailing list. Some members of the mailing
list also interact on the #bsddocs
IRC channel on EFnet.
Install the
textproc/docproj
package or port. This meta-port installs all of the
utilities needed by the FDP.
Install a local working copy of the documentation
from a mirror of the FreeBSD repository. For the fastest
download, pick the nearest mirror from the list of Subversion
mirror sites. If /usr/doc already exists, move
or delete it first to prevent file conflicts.
% svn checkout https://svn0.us-west.FreeBSD.org/doc/head /usr/docBefore making any documentation edits, configure your editor to conform to FDP standards. How to do so varies by editor. Some editor configurations are listed in Chapter 10, Writing Style. The editor should be configured as follows:
Word wrap set to 70 characters.
Tab stops set to 2.
Replace each group of 8 leading spaces with a single tab.
Determine which file to edit. Run
svn up within the local working copy
to make sure that it is current. Before making major
changes to a file, discuss the proposed changes first with
the FreeBSD documentation project mailing list.
When making edits, determine which tags and entities are needed to achieve the desired formatting. One way to learn is to compare some text in the HTML formatted version of the document to the tags which surround the text or the entities that represent that text in the XML file. A reference to the commonly used tags and entities can be found in Chapter 4, XML Markup.
Once the edits are complete, check for problems by running:
% igor -R filename.xml | less -RSWhile reviewing the output, edit the file to fix the listed tab errors, spelling mistakes, and improper grammar. Save the changes and rerun this command to find any remaining problems. Repeat until all of the errors that you deem fixable are resolved. If you get stuck trying to fix errors, ask for assistance on the FreeBSD documentation project mailing list.
Always build-test changes before
submitting them. By default, typing
make in the top-level directory of
the type of documentation being edited will generate that
documentation in split HTML format. For example, to build
the English version of the Handbook, type
make in the
en_US.ISO8859-1/books/handbook/
directory. This step is necessary to make sure that the
edits do not break the build.
In order to build the output in other formats, other
make targets are defined in
head/share/mk/doc.docbook.mk. Use
quotes around the list of formats when building more than
one format with a single command.
For example, to convert the document to both
.html and .txt, use
this command:
% make FORMATS="html txt"Once these steps are successfully completed, generate a
“diff file” of the changes. While in /usr/doc, run this command,
replacing bsdinstall with the
name of the directory containing the edits:
% svn diff > bsdinstall.diff.txtSubmit the diff file using the web-based Problem
Report system or with send-pr(1). If using
the web form, input a synopsis of [patch]
short description of
problem. Select the category
docs and the class
doc-bug. The body of the message
should contain a short description of the edits and any
important discussion points. Use the
button to
attach the .diff.txt file and enter
the captcha phrase.
It is important to remember that the FDP is comprised of volunteers who review edits in their spare time and who live in different time zones across the globe. It takes time to review edits and to either commit them or respond if additional edits are required. If you do not receive a response in a reasonable amount of time, send a follow-up email to the FreeBSD documentation project mailing list and ask if anyone has had a chance to review the patch or if additional information is required.
The FDP uses a number of different software tools to help manage the FreeBSD documentation, convert it to different output formats, and so on. You will need to use these tools yourself if you are to work with the FreeBSD documentation.
All these tools are available as FreeBSD Ports and Packages, greatly simplifying the work you have to do to install them.
You will need to install these tools before you work through any of the examples in later chapters. The actual usage of these tools is covered in later chapters.
textproc/docproj If
Possible: You can save yourself a lot of time if you install the
textproc/docproj port. This
is a meta-port which does not contain any
software itself. Instead, it depends on various other ports
being installed correctly. Installing this port
should automatically download and install
all of the packages listed in this chapter that you need.
One of the packages that you might need is the JadeTeX macro set. In turn, this macro set requires TeX to be installed. TeX is a large package, and you only need it if you want to produce Postscript or PDF output.
To save yourself time and space you must specify whether or not you want JadeTeX (and therefore TeX) installed when you install this port. Either do:
# make JADETEX=yes installor
# make JADETEX=no installas necessary. Alternatively you may install
textproc/docproj-jadetex or
textproc/docproj-nojadetex.
These slave ports define the JADETEX variable
for you, therefore they will install the same suite of
applications on your machine. Note that you can produce only
XHTML or ASCII text output if you do not install
JadeTeX. PostScript or PDF output
requires TeX.
These programs are required before you can usefully work
with the FreeBSD documentation, and they will allow you to
convert the documentation to XHTML, plain text, and RTF
formats. They are all included in textproc/docproj.
textproc/jade)A DSSSL implementation. Used for converting marked up documents to other formats, including HTML and TeX.
www/links)A text-mode WWW browser that can also convert XHTML files to plain text.
graphics/peps)Some of the documentation includes images, some of which are stored as EPS files. These must be converted to PNG before most web browsers will display them.
These are the DTDs and entity sets used by the FDP. They need to be installed before you can work with any of the documentation.
textproc/xhtml)XHTML is the markup language of choice for the World Wide Web, and is used throughout the FreeBSD web site.
textproc/docbook-xml-450)DocBook is designed for marking up technical documentation. All the FreeBSD documentation is written in DocBook.
textproc/iso8879)19 of the ISO 8879:1986 character entity sets used by many DTDs. Includes named mathematical symbols, additional characters in the Latin character set (accents, diacriticals, and so on), and Greek symbols.
You do not need to have any of the following installed. However, you may find it easier to work with the documentation if you do, and they may give you more flexibility in the output formats that can be generated.
print/jadetex,
print/teTeX and
textproc/dsssl-docbook-modular)Jade, teTeX and Modular DocBook Stylesheets are used to convert DocBook documents to DVI, Postscript, and PDF formats. The JadeTeX macros are needed in order to do this.
If you do not intend to convert your documentation to one of these formats (i.e., HTML and plain text are sufficient) then you do not need to install these.
If you decide to install
JadeTeX and
teTeX then you will need to
configure teTeX after
JadeTeX has been installed.
print/jadetex/pkg-message
contains detailed instructions explaining what you
need to do.
editors/emacs or
editors/xemacs)Both these editors include a special mode for editing documents marked up according to an SGML DTD. This mode includes commands to reduce the amount of typing you need, and help reduce the possibility of errors.
You do not need to use them; any text editor can be used to edit marked up documents. You may find they make you more efficient.
If anyone has recommendations for other software that is
useful when manipulating XML documents, please let Documentation Engineering Team <doceng@FreeBSD.org>
know, so they can be added to this list.
The majority of FDP documentation is written in applications of XML. This chapter explains exactly what that means, how to read and understand the source to the documentation, and the sort of XML tricks you will see used in the documentation.
Portions of this section were inspired by Mark Galassi's Get Going With DocBook.
Way back when, electronic text was simple to deal with. Admittedly, you had to know which character set your document was written in (ASCII, EBCDIC, or one of a number of others) but that was about it. Text was text, and what you saw really was what you got. No frills, no formatting, no intelligence.
Inevitably, this was not enough. Once you have text in a machine-usable format, you expect machines to be able to use it and manipulate it intelligently. You would like to indicate that certain phrases should be emphasized, or added to a glossary, or be hyperlinks. You might want filenames to be shown in a “typewriter” style font for viewing on screen, but as “italics” when printed, or any of a myriad of other options for presentation.
It was once hoped that Artificial Intelligence (AI) would make this easy. Your computer would read in the document and automatically identify key phrases, filenames, text that the reader should type in, examples, and more. Unfortunately, real life has not happened quite like that, and our computers require some assistance before they can meaningfully process our text.
More precisely, they need help identifying what is what. Let's look at this text:
To remove
/tmp/foouse rm(1).%rm /tmp/foo
It is easy to see which parts are filenames, which are commands to be typed in, which parts are references to manual pages, and so on. But the computer processing the document cannot. For this we need markup.
“Markup” is commonly used to describe “adding value” or “increasing cost”. The term takes on both these meanings when applied to text. Markup is additional text included in the document, distinguished from the document's content in some way, so that programs that process the document can read the markup and use it when making decisions about the document. Editors can hide the markup from the user, so the user is not distracted by it.
The extra information stored in the markup adds value to the document. Adding the markup to the document must typically be done by a person—after all, if computers could recognize the text sufficiently well to add the markup then there would be no need to add it in the first place. This increases the cost (i.e., the effort required) to create the document.
The previous example is actually represented in this document like this:
As you can see, the markup is clearly separate from the content.
Obviously, if you are going to use markup you need to define what your markup means, and how it should be interpreted. You will need a markup language that you can follow when marking up your documents.
Of course, one markup language might not be enough. A markup language for technical documentation has very different requirements than a markup language that was to be used for cookery recipes. This, in turn, would be very different from a markup language used to describe poetry. What you really need is a first language that you use to write these other markup languages. A meta markup language.
This is exactly what the eXtensible Markup Language (XML) is. Many markup languages have been written in XML, including the two most used by the FDP, XHTML and DocBook.
Each language definition is more properly called a grammar, vocabulary, schema or Document Type Definition (DTD). There are various languages to specify an XML grammar, for example, DTD (yes, it also means the specification language itself), XML Schema (XSD) or RELANG NG. The schema specifies the name of the elements that can be used, what order they appear in (and whether some markup can be used inside other markup) and related information.
A schema is a complete specification of all the elements that are allowed to appear, the order in which they should appear, which elements are mandatory, which are optional, and so forth. This makes it possible to write an XML parser which reads in both the schema and a document which claims to conform to the schema. The parser can then confirm whether or not all the elements required by the vocabulary are in the document in the right order, and whether there are any errors in the markup. This is normally referred to as “validating the document”.
This processing simply confirms that the choice of elements, their ordering, and so on, conforms to that listed in the grammar. It does not check that you have used appropriate markup for the content. If you tried to mark up all the filenames in your document as function names, the parser would not flag this as an error (assuming, of course, that your schema defines elements for filenames and functions, and that they are allowed to appear in the same place).
It is likely that most of your contributions to the Documentation Project will consist of content marked up in either XHTML or DocBook, rather than alterations to the schemas. For this reason this book will not touch on how to write a vocabulary.
All the vocabularies written in XML share certain characteristics. This is hardly surprising, as the philosophy behind XML will inevitably show through. One of the most obvious manifestations of this philosophy is that of content and elements.
Your documentation (whether it is a single web page, or a lengthy book) is considered to consist of content. This content is then divided (and further subdivided) into elements. The purpose of adding markup is to name and identify the boundaries of these elements for further processing.
For example, consider a typical book. At the very top level, the book is itself an element. This “book” element obviously contains chapters, which can be considered to be elements in their own right. Each chapter will contain more elements, such as paragraphs, quotations, and footnotes. Each paragraph might contain further elements, identifying content that was direct speech, or the name of a character in the story.
You might like to think of this as “chunking” content. At the very top level you have one chunk, the book. Look a little deeper, and you have more chunks, the individual chapters. These are chunked further into paragraphs, footnotes, character names, and so on.
Notice how you can make this differentiation between different elements of the content without resorting to any XML terms. It really is surprisingly straightforward. You could do this with a highlighter pen and a printout of the book, using different colors to indicate different chunks of content.
Of course, we do not have an electronic highlighter pen, so we need some other way of indicating which element each piece of content belongs to. In languages written in XML (XHTML, DocBook, et al) this is done by means of tags.
A tag is used to identify where a particular element starts, and where the element ends. The tag is not part of the element itself. Because each grammar was normally written to mark up specific types of information, each one will recognize different elements, and will therefore have different names for the tags.
For an element called
element-name the start tag will
normally look like
. The
corresponding closing tag for this element is
element-name/.element-name
XHTML has an element for indicating that the content
enclosed by the element is a paragraph, called
p.
Some elements have no content. For example, in XHTML you can indicate that you want a horizontal line to appear in the document.
For such elements, that have no content at all, XML introduced a shorthand form, which is ccompletely equivalent to the above form:
XHTML has an element for indicating a horizontal rule,
called hr. This element does not wrap
content, so it looks like this.
For such elements, that have no content at all, XML introduced a shorthand form, which is ccompletely equivalent to the above form:
If it is not obvious by now, elements can contain other elements. In the book example earlier, the book element contained all the chapter elements, which in turn contained all the paragraph elements, and so on.
emThe grammar will specify the rules detailing which elements can contain other elements, and exactly what they can contain.
People often confuse the terms tags and elements, and use the terms as if they were interchangeable. They are not.
An element is a conceptual part of your document. An element has a defined start and end. The tags mark where the element starts and end.
When this document (or anyone else knowledgeable about
XML) refers to “the p tag”
they mean the literal text consisting of the three characters
<, p, and
>. But the phrase “the
p element” refers to the whole
element.
This distinction is very subtle. But keep it in mind.
Elements can have attributes. An attribute has a name and a value, and is used for adding extra information to the element. This might be information that indicates how the content should be rendered, or might be something that uniquely identifies that occurrence of the element, or it might be something else.
An element's attributes are written
inside the start tag for that element, and
take the form
.attribute-name="attribute-value"
In XHTML, the
p element has an attribute called
align, which suggests an alignment
(justification) for the paragraph to the program displaying the
XHTML.
The align attribute can take one of four
defined values, left,
center, right and
justify. If the attribute is not specified
then the default is left.
Some attributes will only take specific values, such as
left or justify. Others
will allow you to enter anything you want.
XML requires you to quote each attribute value with either single or double quotes. It is more habitual to use double quotes but you may use single quotes, as well. Using single quotes is practical if you want to include double quotes in the attribute value.
The information on attributes, elements, and tags is stored
in XML catalogs. The various Documentation Project tools use
these catalog files to validate your work. The tools in
textproc/docproj include a
variety of XML catalog files. The FreeBSD Documentation
Project includes its own set of catalog files. Your tools need
to know about both sorts of catalog files.
In order to run the examples in this document you will need to install some software on your system and ensure that an environment variable is set correctly.
Download and install
textproc/docproj from
the FreeBSD ports system. This is a
meta-port that should download and
install all of the programs and supporting files that are
used by the Documentation Project.
Add lines to your shell startup files to set
SGML_CATALOG_FILES. (If you are not working
on the English version of the documentation, you will want
to substitute the correct directory for your
language.)
Then either log out, and log back in again, or run those commands from the command line to set the variable values.
Create example.xml, and enter
the following text:
Try to validate this file using an XML parser.
Part of
textproc/docproj is
the xmllint
validating
parser.
Use xmllint in the following way to
check that your document is valid:
% xmllint --valid --noout example.xmlAs you will see, xmllint returns
without displaying any output. This means that your
document validated successfully.
See what happens when required elements are omitted.
Try removing the title and
/title tags, and re-run the
validation.
% xmllint --valid --noout example.xml
example.xml:5: element head: validity error : Element head content does not follow the DTD, expecting ((script | style | meta | link | object | isindex)* , ((title , (script | style | meta | link | object | isindex)* , (base , (script | style | meta | link | object | isindex)*)?) | (base , (script | style | meta | link | object | isindex)* , title , (script | style | meta | link | object | isindex)*))), got ()This line tells you that the validation error comes from
the fifth line of the
example.xml file and that the
content of the head is the part, which
does not follow the rules described by the XHTML grammar.
Below this line xmllint will show you
the line where the error has been found and will also mark the
exact character position with a ^ sign.
Put the title element back
in.
The beginning of each document that you write may specify the name of the DTD that the document conforms to in case you use the DTD specification language. Other specification languages, like XML Schema and RELAX NG are not referred in the source document. This DOCTYPE declaration serves the XML parsers so that they can determine the DTD and ensure that the document does conform to it.
A typical declaration for a document written to conform with version 1.0 of the XHTML DTD looks like this:
That line contains a number of different components.
<!Is the indicator that indicates that this is an XML declaration. This line is declaring the document type.
DOCTYPEShows that this is an XML declaration for the document type.
htmlNames the first element that will appear in the document.
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"Lists the Formal Public Identifier (FPI) for the DTD that this document conforms to. Your XML parser will use this to find the correct DTD when processing this document.
PUBLIC is not a part of the FPI,
but indicates to the XML processor how to find the DTD
referenced in the FPI. Other ways of telling the XML
parser how to find the DTD are shown later.
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"A local filename or an URL to find the DTD.
>Returns to the document.
You do not need to know this, but it is useful background, and might help you debug problems when your XML processor can not locate the DTD you are using.
FPIs must follow a specific syntax. This syntax is as follows:
Owner//Keyword Description//Language"OwnerThis indicates the owner of the FPI.
If this string starts with “ISO” then
this is an ISO owned FPI. For example, the FPI
"ISO 8879:1986//ENTITIES Greek
Symbols//EN" lists
ISO 8879:1986 as being the owner for
the set of entities for Greek symbols. ISO 8879:1986 is
the ISO number for the SGML standard, the predecessor
(and a superset) of XML.
Otherwise, this string will either look like
-//
or
Owner+//
(notice the only difference is the leading
Owner+ or -).
If the string starts with - then
the owner information is unregistered, with a
+ it identifies it as being
registered.
ISO 9070:1991 defines how registered names are generated; it might be derived from the number of an ISO publication, an ISBN code, or an organization code assigned according to ISO 6523. In addition, a registration authority could be created in order to assign registered names. The ISO council delegated this to the American National Standards Institute (ANSI).
Because the FreeBSD Project has not been registered
the owner string is -//FreeBSD. And
as you can see, the W3C are not a registered owner
either.
KeywordThere are several keywords that indicate the type of
information in the file. Some of the most common
keywords are DTD,
ELEMENT, ENTITIES,
and TEXT. DTD is
used only for DTD files, ELEMENT is
usually used for DTD fragments that contain only entity
or element declarations. TEXT is
used for XML content (text and tags).
DescriptionAny description you want to supply for the contents of this file. This may include version numbers or any short text that is meaningful to you and unique for the XML system.
LanguageThis is an ISO two-character code that identifies
the native language for the file. EN
is used for English.
If you use the syntax above and process this document using an XML processor, the processor will need to have some way of turning the FPI into the name of the file on your computer that contains the DTD.
In order to do this it can use a catalog file. A
catalog file (typically called catalog)
contains lines that map FPIs to filenames. For example, if
the catalog file contained the line:
The XML processor would know to look up the DTD from
transitional.dtd in the
1.0 subdirectory of whichever directory
held the catalog file that contained
that line.
Look at the contents of
/usr/local/share/xml/dtd/xhtml/catalog.xml.
This is the catalog file for the XHTML DTDs that will have
been installed as part of the textproc/docproj port.
In order to locate a catalog file,
your XML processor will need to know where to look. Many
of them feature command line parameters for specifying the
path to one or more catalogs.
In addition, you can set
SGML_CATALOG_FILES to point to the files.
This environment variable should consist of a
colon-separated list of catalog files (including their full
path).
Typically, you will want to include the following files:
/usr/local/share/xml/docbook/4.1/catalog
/usr/local/share/xml/html/catalog
/usr/local/share/xml/iso8879/catalog
/usr/local/share/xml/jade/catalog
You should already have done this.
Instead of using an FPI to indicate the DTD that the document conforms to (and therefore, which file on the system contains the DTD) you can explicitly specify the name of the file.
The syntax for this is slightly different:
The SYSTEM keyword indicates that the
XML processor should locate the DTD in a system specific
fashion. This typically (but not always) means the DTD will
be provided as a filename.
Using FPIs is preferred for reasons of portability. You
do not want to have to ship a copy of the DTD around with your
document, and if you used the SYSTEM
identifier then everyone would need to keep their DTDs in the
same place.
As mentioned earlier, XML is only used when writing a DTD. This is not strictly true. There is certain XML syntax that you will want to be able to use within your documents. For example, comments can be included in your document, and will be ignored by the parser. Comments are entered using XML syntax. Other uses for XML syntax in your document will be shown later too.
Obviously, you need some way of indicating to the XML processor that the following content is not elements within the document, but is XML that the parser should act upon.
These sections are marked by
<! ... > in your document. Everything
between these delimiters is XML syntax as you might find within
a DTD.
As you may just have realized, the DOCTYPE declaration is an example of XML syntax that you need to include in your document…
Comments are an XML construction, and are normally only valid inside a DTD. However, as Section 3.4, “Escaping Back to SGML” shows, it is possible to use XML syntax within your document.
The delimiter for XML comments is the string
“--”. The first occurrence of
this string opens a comment, and the second closes it.
If you have used XHTML before you may have been shown
different rules for comments. In particular, you may think that
the string <!-- opens a comment, and it is
only closed by -->.
This is not the case. A lot of web browsers have broken XHTML parsers, and will accept that as valid. However, the XML parsers used by the Documentation Project are much stricter, and will reject documents that make that error.
The XML parser will treat this as though it were actually:
This is not valid XML, and may give confusing error messages.
As the example suggests, do not write comments like that.
That is a (slightly) better approach, but it still potentially confusing to people new to XML.
Entities are a mechanism for assigning names to chunks of content. As an XML parser processes your document, any entities it finds are replaced by the content of the entity.
This is a good way to have re-usable, easily changeable chunks of content in your XML documents. It is also the only way to include one marked up file inside another using XML.
There are two types of entities which can be used in two different situations; general entities and parameter entities.
You cannot use general entities in an XML context (although you define them in one). They can only be used in your document. Contrast this with parameter entities.
Each general entity has a name. When you want to
reference a general entity (and therefore include whatever
text it represents in your document), you write
&.
For example, suppose you had an entity called
entity-name;current.version which expanded to the
current version number of your product. You could
write:
When the version number changes you can simply change the definition of the value of the general entity and reprocess your document.
You can also use general entities to enter characters that
you could not otherwise include in an XML document. For
example, < and &
cannot normally appear in an XML document. When the XML
parser sees the < symbol it assumes that
a tag (either a start tag or an end tag) is about to appear,
and when it sees the & symbol it
assumes the next text will be the name of an entity.
Fortunately, you can use the two general entities
< and &
whenever you need to include one or other of these.
A general entity can only be defined within an XML context. Typically, this is done immediately after the DOCTYPE declaration.
Notice how the DOCTYPE declaration has been extended by adding a square bracket at the end of the first line. The two entities are then defined over the next two lines, before the square bracket is closed, and then the DOCTYPE declaration is closed.
The square brackets are necessary to indicate that we are extending the DTD indicated by the DOCTYPE declaration.
Like general entities, parameter entities are used to assign names to reusable chunks of text. However, whereas general entities can only be used within your document, parameter entities can only be used within an XML context.
Parameter entities are defined in a similar way to general
entities. However, instead of using
&
to refer to them, use
entity-name;%
[1]. The definition also includes
the entity-name;% between the ENTITY
keyword and the name of the entity.
This may not seem particularly useful. It will be.
Add a general entity to
example.xml.
Validate the document using
xmllint.
Load example.xml into your web
browser (you may need to copy it to
example.html before your browser
recognizes it as an XHTML document).
Unless your browser is very advanced, you will not see
the entity reference &version;
replaced with the version number. Most web browsers have
very simplistic parsers which do not handle XML DTD
constructs. Furthermore, the closing ]<
of the XML context are not recognized properly by browser and
will probably be rendered.
The solution is to normalize your document using an XML normalizer. The normalizer reads in valid XML and outputs equally valid XML which has been transformed in some way. One of the ways in which the normalizer transforms the XML is to expand all the entity references in the document, replacing the entities with the text that they represent.
You can use xmllint to do
this. It also has an option to drop the initial
DTD section so that the closing ]<
does not confuse browsers:
% xmllint --noent --dropdtd example.xml > example.htmlYou should find a normalized (i.e., entity references
expanded) copy of your document in
example.html, ready to load into your
web browser.
Entities (both general and parameter) are particularly useful when used to include one file inside another.
Suppose you have some content for an XML book organized
into files, one file per chapter, called
chapter1.xml,
chapter2.xml, and so forth, with a
book.xml file that will contain these
chapters.
In order to use the contents of these files as the values
for your entities, you declare them with the
SYSTEM keyword. This directs the XML
parser to use the contents of the named file as the value of
the entity.
When using general entities to include other files
within a document, the files being included
(chapter1.xml,
chapter2.xml, and so on)
must not start with a DOCTYPE
declaration. This is a syntax error because entities
are low-level constructs and they are resolved before
any parsing happens.
Recall that parameter entities can only be used inside an XML context. Why then would you want to include a file within an XML context?
You can use this to ensure that you can reuse your general entities.
Suppose that you had many chapters in your document, and you reused these chapters in two different books, each book organizing the chapters in a different fashion.
You could list the entities at the top of each book, but this quickly becomes cumbersome to manage.
Instead, place the general entity definitions inside one file, and use a parameter entity to include that file within your document.
First, place your entity definitions in a separate file,
called chapters.ent. This file
contains the following:
Now create a parameter entity to refer to the contents of the file. Then use the parameter entity to load the file into the document, which will then make all the general entities available for use. Then use the general entities as before:
Create three files, para1.xml,
para2.xml, and
para3.xml.
Put content similar to the following in each file:
Edit example.xml so that it
looks like this:
Produce example.html by
normalizing example.xml.
% xmllint --dropdtd --noent example.xml > example.htmlLoad example.html into your web
browser, and confirm that the
para
files have been included in
n.xmlexample.html.
You must have taken the previous steps first.
Edit example.xml so that it
looks like this:
Create a new file,
entities.ent, with this
content:
Produce example.html by
normalizing example.xml.
% xmllint --dropdtd --noent example.xml > example.htmlLoad example.html into your web
browser, and confirm that the
para
files have been included in
n.xmlexample.html.
XML provides a mechanism to indicate that particular pieces of the document should be processed in a special way. These are termed “marked sections”.
As you would expect, being an XML construct, a marked
section starts with <!.
The first square bracket begins to delimit the marked section.
KEYWORD describes how this marked
section should be processed by the parser.
The second square bracket indicates that the content of the marked section starts here.
The marked section is finished by closing the two square
brackets, and then returning to the document context from the
XGML context with >.
These keywords denote the marked sections content model, and allow you to change it from the default.
When an XML parser is processing a document it keeps track of what is called the “content model”.
Briefly, the content model describes what sort of content the parser is expecting to see, and what it will do with it when it finds it.
The content model you will probably find most
useful is CDATA.
CDATA is for “Character
Data”. If the parser is in this content model then
it is expecting to see characters, and characters only. In
this model the < and
& symbols lose their special status,
and will be treated as ordinary characters.
When you use CDATA
in examples of text marked up in
XML, keep in mind that the content of
CDATA is not validated. You have to
check the included XML text using other means. You
could, for example, write the example in another document,
validate the example code, and then paste it to your
CDATA content.
CDATA Marked
SectionIf you look at the source for this document you will see this technique used throughout.
If the keyword is INCLUDE then the
contents of the marked section will be processed. If the
keyword is IGNORE then the marked section
is ignored and will not be processed. It will not appear in
the output.
INCLUDE and
IGNORE in Marked SectionsBy itself, this is not too useful. If you wanted to remove text from your document you could cut it out, or wrap it in comments.
It becomes more useful when you realize you can use parameter entities to control this, yet this usage is limited to entity files.
For example, suppose that you produced a hard-copy version of some documentation and an electronic version. In the electronic version you wanted to include some extra content that was not to appear in the hard-copy.
Create an entity file that defines general entities
to include each chapter and guard these definitions with
a parameter entity that can be set to either
INCLUDE or IGNORE
to control whether the entity is defined. After these
conditional general entity definitions, place one more
definition for each general entity to set them to an
empty value. This technique makes use of the fact that
entity definitions cannot be overridden but always the
first definition takes effect. So you can control the
inclusion of your chapter with the corrsponding parameter
entity; if you set it to INCLUDE, the
first general entity definition will be read and the
second one will be ignored but if you set it to
IGNORE, the first definition will be
ignored and the second one will take effect.
When producing the hard-copy version, change the parameter entity's definition to:
Modify the entities.ent file to contain
the following:
Normalize the example.xml file and notice
that the conditional text is not present on the output document.
Now if you set the parameter entity guard to INCLUDE
and regenerate the normalized document, it will appear there again.
Of course, this method makes more sense if you have more conditional
chunks that depend on the same condition, for example, whether you are
generating printed or online text.
That is the conclusion of this XML primer. For reasons of space and complexity several things have not been covered in depth (or at all). However, the previous sections cover enough XML for you to be able to follow the organization of the FDP documentation.
This chapter describes the two markup languages you will encounter when you contribute to the FreeBSD documentation project. Each section describes the markup language, and details the markup that you are likely to want to use, or that is already in use.
These markup languages contain a large number of elements, and it can be confusing sometimes to know which element to use for a particular situation. This section goes through the elements you are most likely to need, and gives examples of how you would use them.
This is not an exhaustive list of elements, since that would just reiterate the documentation for each language. The aim of this section is to list those elements more likely to be useful to you. If you have a question about how best to markup a particular piece of content, please post it to the FreeBSD documentation project mailing list.
In the remainder of this document, when describing elements, inline means that the element can occur within a block element, and does not cause a line break. A block element, by comparison, will cause a line break (and other processing) when it is encountered.
XHTML is the XML version of the HyperText Markup Language, which is the markup language of choice on the World Wide Web. More information can be found at http://www.w3.org/.
XHTML is used to markup pages on the FreeBSD web site. It should not (generally) be used to mark up other documentation, since DocBook offers a far richer set of elements to choose from. Consequently, you will normally only encounter XHTML pages if you are writing for the web site.
HTML has gone through a number of versions, 1, 2, 3.0, 3.2, 4.0 and then an XML-compliant version has also been created, which is called XHTML and the latest widespread version of it is XHTML 1.0(available in both strict and transitional variants).
The XHTML DTDs are available from the Ports Collection
in the textproc/xhtml port.
They are automatically installed as part of the textproc/docproj port.
There are a number of XHTML FPIs, depending upon the version (also known as the level) of XHTML that you want to declare your document to be compliant with.
The majority of XHTML documents on the FreeBSD web site comply with the transitional version of XHTML 1.0.
An XHTML document is normally split into two sections. The first section, called the head, contains meta-information about the document, such as its title, the name of the author, the parent document, and so on. The second section, the body, contains the content that will be displayed to the user.
These sections are indicated with head
and body elements respectively. These
elements are contained within the top-level
html element.
The Document's Title</title>
</head>
<body>
…
</body>
</html>XHTML allows you to denote headings in your document, at up to six different levels.
The largest and most prominent heading is
h1, then h2,
continuing down to h6.
The element's content is the text of the heading.
h1, h2,
and Other Header TagsUse:
Generally, an XHTML page should have one first level
heading (h1). This can contain many
second level headings (h2), which can in
turn contain many third level headings. Each
h element
should have the same element, but one further up the
hierarchy, preceding it. Leaving gaps in the numbering is
to be avoided.n
hn
ElementsUse:
XHTML supports a single paragraph element,
p.
A block quotation is an extended quotation from another document that should not appear within the current paragraph.
blockquoteUse:
You can present the user with three types of lists, ordered, unordered, and definition.
Typically, each entry in an ordered list will be numbered, while each entry in an unordered list will be preceded by a bullet point. Definition lists are composed of two sections for each entry. The first section is the term being defined, and the second section is the definition of the term.
Ordered lists are indicated by the ol
element, unordered lists by the ul
element, and definition lists by the dl
element.
Ordered and unordered lists contain listitems, indicated
by the li element. A listitem can
contain textual content, or it may be further wrapped in one
or more p elements.
Definition lists contain definition terms
(dt) and definition descriptions
(dd). A definition term can only contain
inline elements. A definition description can contain other
block elements.
ul and
olUse:
dlUse:
You can indicate that text should be shown to the user exactly as it is in the file. Typically, this means that the text is shown in a fixed font, multiple spaces are not merged into one, and line breaks in the text are significant.
In order to do this, wrap the content in the
pre element.
preYou could use pre to mark up an
email message:
Keep in mind that < and
& still are recognized as special
characters in pre-formatted text. This is why the example
shown had to use < instead of
<. For consistency,
> was used in place of
>, too. Watch out for the special
characters that may appear in text copied from a
plain-text source, e.g., an email message or program
code.
Most text-mode browsers (such as Lynx) do not render tables particularly effectively. If you are relying on the tabular display of your content, you should consider using alternative markup to prevent confusion.
Mark up tabular information using the
table element. A table consists of one
or more table rows (tr), each containing
one or more cells of table data (td).
Each cell can contain other block elements, such as
paragraphs or lists. It can also contain another table
(this nesting can repeat indefinitely). If the cell only
contains one paragraph then you do not need to include the
p element.
tableUse:
A cell can span multiple rows and columns. To indicate
this, add the rowspan and/or
colspan attributes, with values
indicating the number of rows or columns that should be
spanned.
rowspanUse:
colspanUse:
rowspan and
colspan TogetherUse:
You have two levels of emphasis available in XHTML,
em and strong.
em is for a normal level of emphasis and
strong indicates stronger
emphasis.
Typically, em is rendered in italic
and strong is rendered in bold. This is
not always the case, however, and you should not rely on
it. According to best practices, webpages only hold
structural and semantical information and stylesheets are
later applied to use these two so you should think of
semantics not formatting when using these tags.
em and
strongUse:
Links are also inline elements.
In order to include a link to another document on the WWW you must know the URL of the document you want to link to.
The link is indicated with a, and the
href attribute contains the URL of the
target document. The content of the element becomes the
link, and is normally indicated to the user in some way
(underlining, change of color, different mouse cursor when
over the link, and so on).
<a href="...">Use:
These links will take the user to the top of the chosen document.
Linking to a point within another document (or within the same document) requires that the document author include anchors that you can link to.
Anchors are indicated with a and the
id attribute instead of
href.
<a id="...">Use:
To link to a named part of a document, write a normal
link to that document, but include the id of the anchor
after a # symbol.
Assume that the para1 example
resides in a document called
foo.html.
If you are linking to a named anchor within the same
document then you can omit the document's URL, and just
include the name of the anchor (with the preceding
#).
Assume that the para1 example
resides in this document:
DocBook was originally developed by HaL Computer Systems and O'Reilly & Associates to be a DTD for writing technical documentation [2]. Since 1998 it is maintained by the DocBook Technical Committee. As such, and unlike LinuxDoc and XHTML, DocBook is very heavily oriented towards markup that describes what something is, rather than describing how it should be presented.
Some elements may exist in two forms, formal and informal. Typically, the formal version of the element will consist of a title followed by the informal version of the element. The informal version will not have a title.
The DocBook DTD is available from the Ports Collection
in the textproc/docbook-xml-450
port. It is automatically installed as part of the textproc/docproj port.
The FreeBSD Documentation Project has extended the DocBook DTD by adding some new elements. These elements serve to make some of the markup more precise.
Where a FreeBSD specific element is listed below it is clearly marked.
Throughout the rest of this document, the term “DocBook” is used to mean the FreeBSD extended DocBook DTD.
There is nothing about these extensions that is FreeBSD
specific, it was just felt that they were useful
enhancements for this particular project. Should anyone
from any of the other *nix camps (NetBSD, OpenBSD, Linux,
…) be interested in collaborating on a standard
DocBook extension set, please get in touch with
Documentation Engineering Team <doceng@FreeBSD.org>.
The FreeBSD extensions are not (currently) in the Ports Collection. They are stored in the FreeBSD Subversion tree, as head/share/xml/freebsd.dtd.
In compliance with the DocBook guidelines for writing FPIs for DocBook customizations, the FPI for the FreeBSD extended DocBook DTD is:
DocBook allows you to structure your documentation in several ways. In the FreeBSD Documentation Project we are using two primary types of DocBook document: the book and the article.
A book is organized into chapters.
This is a mandatory requirement. There may be
parts between the book and the chapter to
provide another layer of organization. For example, the
Handbook is arranged in this way.
A chapter may (or may not) contain one or more sections.
These are indicated with the sect1 element.
If a section contains another section then use the
sect2 element, and so on, up to
sect5.
Chapters and sections contain the remainder of the content.
An article is simpler than a book, and does not use
chapters. Instead, the content of an article is organized
into one or more sections, using the same
sect1 (and sect2 and so
on) elements that are used in books.
Obviously, you should consider the nature of the documentation you are writing in order to decide whether it is best marked up as a book or an article. Articles are well suited to information that does not need to be broken down into several chapters, and that is, relatively speaking, quite short, at up to 20-25 pages of content. Books are best suited to information that can be broken up into several chapters, possibly with appendices and similar content as well.
The FreeBSD tutorials are all marked up as articles, while this document, the FreeBSD FAQ, and the FreeBSD Handbook are all marked up as books, for example.
The content of the book is contained within the
book element. As well as containing
structural markup, this element can contain elements that
include additional information about the book. This is
either meta-information, used for reference purposes, or
additional content used to produce a title page.
This additional information should be contained within
bookinfo.
book with
bookinfoYour Title Here</title>
<author>
<firstname>Your first name</firstname>
<surname>Your surname</surname>
<affiliation>
<address><email>Your email address</email></address>
</affiliation>
</author>
<copyright>
<year>1998</year>
<holder role="mailto:your email address">Your name</holder>
</copyright>
<releaseinfo>$FreeBSD$</releaseinfo>
<abstract>
<para>Include an abstract of the book's contents here.</para>
</abstract>
</bookinfo>
…
</book>The content of the article is contained within the
article element. As well as containing
structural markup, this element can contain elements that
include additional information about the article. This is
either meta-information, used for reference purposes, or
additional content used to produce a title page.
This additional information should be contained within
articleinfo.
article with
articleinfoYour title here</title>
<author>
<firstname>Your first name</firstname>
<surname>Your surname</surname>
<affiliation>
<address><email>Your email address</email></address>
</affiliation>
</author>
<copyright>
<year>1998</year>
<holder role="mailto:your email address">Your name</holder>
</copyright>
<releaseinfo>$FreeBSD$</releaseinfo>
<abstract>
<para>Include an abstract of the article's contents here.</para>
</abstract>
</articleinfo>
…
</article>Use chapter to mark up your chapters.
Each chapter has a mandatory title.
Articles do not contain chapters, they are reserved for
books.
A chapter cannot be empty; it must contain elements in
addition to title. If you need to
include an empty chapter then just use an empty
paragraph.
In books, chapters may (but do not need to) be broken up
into sections, subsections, and so on. In articles,
sections are the main structural element, and each article
must contain at least one section. Use the
sect element.
The nn indicates the section
number, which identifies the section level.
The first
sect is
nsect1. You can have one or more of these
in a chapter. They can contain one or more
sect2 elements, and so on, down to
sect5.
This example includes section numbers in the section titles. You should not do this in your documents. Adding the section numbers is carried out by the stylesheets (of which more later), and you do not need to manage them yourself.
You can introduce another layer of organization between
book and chapter with
one or more parts. This cannot be done
in an article.
DocBook supports three types of paragraphs:
formalpara, para, and
simpara.
Most of the time you will only need to use
para. formalpara
includes a title element, and
simpara disallows some elements from
within para. Stick with
para.
paraUse:
Appearance:
This is a paragraph. It can contain just about any other element.
A block quotation is an extended quotation from another document that should not appear within the current paragraph. You will probably only need it infrequently.
Blockquotes can optionally contain a title and an attribution (or they can be left untitled and unattributed).
blockquoteUse:
Appearance:
A small excerpt from the US Constitution:
Preamble to the Constitution of the United
States We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America. | ||
| --Copied from a web site somewhere | ||
You may need to include extra information separate from the main body of the text. Typically this is “meta” information that the user should be aware of.
Depending on the nature of the information, one of
tip, note,
warning, caution, and
important should be used. Alternatively,
if the information is related to the main text but is not
one of the above, use sidebar.
The circumstances in which to choose one of these elements over another is unclear. The DocBook documentation suggests:
A Note is for information that should be heeded by all readers.
An Important element is a variation on Note.
A Caution is for information regarding possible data loss or software damage.
A Warning is for information regarding possible hardware damage or injury to life or limb.
warningUse:
Appearance:
Installing FreeBSD may make you want to delete Windows from your hard disk.
You will often need to list pieces of information to the user, or present them with a number of steps that must be carried out in order to accomplish a particular goal.
In order to do this, use
itemizedlist,
orderedlist, or
procedure[3]
itemizedlist and
orderedlist are similar to their
counterparts in HTML, ul and
ol. Each one consists of one or more
listitem elements, and each
listitem contains one or more block
elements. The listitem elements are
analogous to HTML's li tags. However,
unlike HTML, they are required.
procedure is slightly different. It
consists of steps, which may in turn
consists of more steps or
substeps. Each step
contains block elements.
itemizedlist,
orderedlist, and
procedureUse:
Appearance:
This is the first itemized item.
This is the second itemized item.
This is the first ordered item.
This is the second ordered item.
Do this.
Then do this.
And now do this.
If you want to show a fragment of a file (or perhaps a
complete file) to the user, wrap it in the
programlisting element.
White space and line breaks within
programlisting are
significant. In particular, this means that the opening tag
should appear on the same line as the first line of the
output, and the closing tag should appear on the same line
as the last line of the output, otherwise spurious blank
lines may be included.
programlistingUse:
Notice how the angle brackets in the
#include line need to be referenced by
their entities instead of being included literally.
Appearance:
When you have finished, your program should look like this:
A callout is a mechanism for referring back to an earlier piece of text or specific position within an earlier example without linking to it within the text.
To do this, mark areas of interest in your example
(programlisting,
literallayout, or whatever) with the
co element. Each element must have a
unique id assigned to it. After the
example include a calloutlist that refers
back to the example and provides additional
commentary.
co and
calloutlistAppearance:
When you have finished, your program should look like this:
Unlike HTML, you do not need to use tables for layout purposes, as the stylesheet handles those issues for you. Instead, just use tables for marking up tabular data.
In general terms (and see the DocBook documentation for
more detail) a table (which can be either formal or
informal) consists of a table element.
This contains at least one tgroup
element, which specifies (as an attribute) the number of
columns in this table group. Within the tablegroup you can
then have one thead element, which
contains elements for the table headings (column headings),
and one tbody which contains the body of
the table.
Both tgroup and
thead contain row
elements, which in turn contain entry
elements. Each entry element specifies
one cell in the table.
informaltableUse:
Appearance:
| This is Column Head 1 | This is Column Head 2 |
|---|---|
| Row 1, column 1 | Row 1, column 2 |
| Row 2, column 1 | Row 2, column 2 |
Always use the pgwide attribute with
a value of 1 with the
informaltable element. A bug in Internet
Explorer can cause the table to render incorrectly if this
is omitted.
If you do not want a border around the table the
frame attribute can be added to the
informaltable element with a value of
none (i.e., <informaltable
frame="none">).
frame="none"Appearance:
| This is Column Head 1 | This is Column Head 2 |
|---|---|
| Row 1, column 1 | Row 1, column 2 |
| Row 2, column 1 | Row 2, column 2 |
A lot of the time you need to show examples for the user to follow. Typically, these will consist of dialogs with the computer; the user types in a command, the user gets a response back, they type in another command, and so on.
A number of distinct elements and entities come into play here.
screenEverything the user sees in this example will be
on the computer screen, so the next element is
screen.
Within screen, white space is
significant.
prompt,
&prompt.root; and
&prompt.user;Some of the things the user will be seeing on the
screen are prompts from the computer (either from the
operating system, command shell, or application).
These should be marked up using
prompt.
As a special case, the two shell prompts for the
normal user and the root user have been provided as
entities. Every time you want to indicate the user is
at a shell prompt, use one of
&prompt.root; and
&prompt.user; as necessary.
They do not need to be inside
prompt.
&prompt.root; and
&prompt.user; are FreeBSD
extensions to DocBook, and are not part of the
original DTD.
userinputWhen displaying text that the user should type in,
wrap it in userinput tags. It will
probably be displayed differently to the user.
screen, prompt,
and userinputUse:
Appearance:
% ls -1
foo1
foo2
foo3
% ls -1 | grep foo2
foo2
% su
Password:
# cat foo2
This is the file called 'foo2'Even though we are displaying the contents of the file
foo2, it is not
marked up as programlisting. Reserve
programlisting for showing fragments of
files outside the context of user actions.
When you want to emphasize a particular word or phrase,
use emphasis. This may be presented as
italic, or bold, or might be spoken differently with a
text-to-speech system.
There is no way to change the presentation of the
emphasis within your document, no equivalent of HTML's
b and i. If the
information you are presenting is important then consider
presenting it in important rather than
emphasis.
emphasisUse:
Appearance:
FreeBSD is without doubt the premiere Unix like operating system for the Intel architecture.
To quote text from another document or source, or to
denote a phrase that is used figuratively, use
quote. Within a quote
tag, you may use most of the markup tags available for
normal text.
Use:
Appearance:
However, make sure that the search does not go beyond the “boundary between local and public administration”, as RFC 1535 calls it.
To refer to a specific key on the keyboard, use
keycap. To refer to a mouse button, use
mousebutton. And to refer to
combinations of key presses or mouse clicks, wrap them all
in keycombo.
keycombo has an attribute called
action, which may be one of
click, double-click,
other, press,
seq, or simul. The
last two values denote whether the keys or buttons should be
pressed in sequence, or simultaneously.
The stylesheets automatically add any connecting
symbols, such as +, between the key
names, when wrapped in keycombo.
Use:
Appearance:
To switch to the second virtual terminal, press Alt+F1.
To exit vi without saving your
work, type Esc : q !.
My window manager is configured so that Alt+ mouse button is used to move windows.
You will frequently want to refer to both applications and commands when writing documentation. The distinction between them is simple: an application is the name for a suite (or possibly just 1) of programs that fulfill a particular task. A command is the name of a program that the user can run.
In addition, you will occasionally need to list one or more of the options that a command might take.
Finally, you will often want to list a command with its manual section number, in the “command(number)” format so common in Unix manuals.
Mark up application names with
application.
When you want to list a command with its manual section
number (which should be most of the time) the DocBook
element is citerefentry. This will
contain a further two elements,
refentrytitle and
manvolnum. The content of
refentrytitle is the name of the command,
and the content of manvolnum is the
manual page section.
This can be cumbersome to write, and so a series of
general
entities have been created to make this easier.
Each entity takes the form
&man..manual-page.manual-section;
The file that contains these entities is in
doc/share/xml/man-refs.ent, and can be
referred to using this FPI:
Therefore, the introduction to your documentation will probably look like this:
Use command when you want to include
a command name “in-line” but present it as
something the user should type in.
Use option to mark up the options
which will be passed to a command.
When referring to the same command multiple times in
close proximity it is preferred to use the
&man.
notation to markup the first reference and use
command.section;command to markup subsequent references.
This makes the generated output, especially HTML, appear
visually better.
This can be confusing, and sometimes the choice is not always clear. Hopefully this example makes it clearer.
Use:
Appearance:
Sendmail is the most widely used Unix mail application.
Sendmail includes the sendmail(8), mailq(1), and newaliases(1) programs.
One of the command line parameters to
sendmail(8), -bp, will display the
current status of messages in the mail queue. Check this
on the command line by running
sendmail -bp.
Notice how the
&man.
notation is easier to follow.command.section;
Whenever you wish to refer to the name of a file, a
directory, or a file extension, use
filename.
filenameUse:
Appearance:
The SGML source for the Handbook in English can be
found in /usr/doc/en/handbook/. The
first file is called handbook.xml in
that directory. You should also see a
Makefile and a number of files with a
.ent extension.
These elements are part of the FreeBSD extension to DocBook, and do not exist in the original DocBook DTD.
You might need to include the name of a program from the
FreeBSD Ports Collection in the documentation. Use the
filename tag with the
role attribute set to
package to identify these. Since ports
can be installed in any number of locations, only include
the category and the port name; do not include
/usr/ports.
filename Tag with
package RoleUse:
Appearance:
Install the net/ethereal port to view
network traffic.
These elements are part of the FreeBSD extension to DocBook, and do not exist in the original DocBook DTD.
When referring to devices you have two choices. You can
either refer to the device as it appears in
/dev, or you can use the name of the
device as it appears in the kernel. For this latter course,
use devicename.
Sometimes you will not have a choice. Some devices,
such as networking cards, do not have entries in
/dev, or the entries are markedly
different from those entries.
devicenameUse:
Appearance:
sio is used for serial
communication in FreeBSD. sio
manifests through a number of entries in
/dev, including
/dev/ttyd0 and
/dev/cuaa0.
By contrast, the networking devices, such as
ed0 do not appear in
/dev.
In MS-DOS, the first floppy drive is referred to as
a:. In FreeBSD it is
/dev/fd0.
These elements are part of the FreeBSD extension to DocBook, and do not exist in the original DocBook DTD.
You can markup identification information for networked
computers (hosts) in several ways, depending on the nature
of the information. All of them use
hostid as the element, with the
role attribute selecting the type of the
marked up information.
role attribute, or
role="hostname"With no role attribute (i.e.,
hostid.../hostid)
the marked up information is the simple hostname, such
as freefall or
wcarchive. You can explicitly
specify this with
role="hostname".
role="domainname"The text is a domain name, such as
FreeBSD.org or
ngo.org.uk. There is no hostname
component.
role="fqdn"The text is a Fully Qualified Domain Name, with both hostname and domain name parts.
role="ipaddr"The text is an IP address, probably expressed as a dotted quad.
role="ip6addr"The text is an IPv6 address.
role="netmask"The text is a network mask, which might be
expressed as a dotted quad, a hexadecimal string, or
as a / followed by a number.
role="mac"The text is an Ethernet MAC address, expressed as a series of 2 digit hexadecimal numbers separated by colons.
hostid and RolesUse:
Appearance:
The local machine can always be referred to by the
name localhost, which will have the IP
address 127.0.0.1.
The FreeBSD.org
domain contains a number of different hosts, including
freefall.FreeBSD.org and
bento.FreeBSD.org.
When adding an IP alias to an interface (using
ifconfig) always
use a netmask of
255.255.255.255
(which can also be expressed as 0xffffffff).
The MAC address uniquely identifies every network card
in existence. A typical MAC address looks like 08:00:20:87:ef:d0.
These elements are part of the FreeBSD extension to DocBook, and do not exist in the original DocBook DTD.
When you need to refer to a specific username, such as
root or bin, use
username.
usernameUse:
Appearance:
To carry out most system administration functions you
will need to be root.
These elements are part of the FreeBSD extension to DocBook, and do not exist in the original DocBook DTD.
Two elements exist to describe parts of
Makefiles,
maketarget and
makevar.
maketarget identifies a build target
exported by a Makefile that can be
given as a parameter to make.
makevar identifies a variable that can be
set (in the environment, on the make
command line, or within the Makefile)
to influence the process.
maketarget and
makevarUse:
Appearance:
Two common targets in a Makefile
are all and
clean.
Typically, invoking all will
rebuild the application, and invoking
clean will remove the temporary
files (.o for example) created by the
build process.
clean may be controlled by a
number of variables, including CLOBBER
and RECURSE.
You will often need to include “literal” text in the documentation. This is text that is excerpted from another file, or which should be copied from the documentation into another file verbatim.
Some of the time, programlisting will
be sufficient to denote this text.
programlisting is not always appropriate,
particularly when you want to include a portion of a file
“in-line” with the rest of the
paragraph.
On these occasions, use
literal.
literalUse:
Appearance:
The maxusers 10 line in the kernel
configuration file determines the size of many system
tables, and is a rough guide to how many simultaneous
logins the system will support.
There will often be times when you want to show the user what to do, or refer to a file, or command line, or similar, where the user cannot simply copy the examples that you provide, but must instead include some information themselves.
replaceable is designed for this
eventuality. Use it inside other
elements to indicate parts of that element's content that
the user must replace.
replaceableUse:
Appearance:
% man commandreplaceable can be used in many
different elements, including literal.
This example also shows that
replaceable should only be wrapped
around the content that the user is
meant to provide. The other content should be left
alone.
Use:
Appearance:
The
maxusers
line in the kernel configuration file determines the size
of many system tables, and is a rough guide to how many
simultaneous logins the system will support.n
For a desktop workstation, 32 is a
good value for n.
Image support in the documentation is currently extremely experimental. The mechanisms described here are unlikely to change, but that is not guaranteed.
You will also need to install the
graphics/ImageMagick
port, which is used to convert between the different image
formats. This is a big port, and most of it is not
required. However, while we are working on the
Makefiles and other infrastructure it
makes things easier. This port is not
in the textproc/docproj
meta port, you must install it by hand.
The best example of what follows in practice is the
doc/en_US.ISO8859-1/articles/vm-design/
document. If you are unsure of the description that
follows, take a look at the files in that directory to see
how everything hangs together. Experiment with creating
different formatted versions of the document to see how the
image markup appears in the formatted output.
We currently support two formats for images. The format you should use will depend on the nature of your image.
For images that are primarily vector based, such as
network diagrams, time lines, and similar, use Encapsulated
Postscript, and make sure that your images have the
.eps extension.
For bitmaps, such as screen captures, use the Portable
Network Graphic format, and make sure that your images have
the .png extension.
These are the only formats in which images should be committed to the Subversion repository.
Use the right format for the right image. It is to be
expected that your documentation will have a mix of EPS and
PNG images. The Makefiles ensure that
the correct format image is chosen depending on the output
format that you use for your documentation. Do
not commit the same image to the repository in two different
formats.
It is anticipated that the Documentation Project will switch to using the Scalable Vector Graphic (SVG) format for vector images. However, the current state of SVG capable editing tools makes this impractical.
The markup for an image is relatively simple. First,
markup a mediaobject. The
mediaobject can contain other, more
specific objects. We are concerned with two, the
imageobject and the
textobject.
You should include one imageobject,
and two textobject elements. The
imageobject will point to the name of the
image file that will be used (without the extension). The
textobject elements contain information
that will be presented to the user as well as, or instead
of, the image.
There are two circumstances where this can happen.
When the reader is viewing the documentation in HTML. In this case, each image will need to have associated alternate text to show the user, typically whilst the image is loading, or if they hover the mouse pointer over the image.
When the reader is viewing the documentation in plain text. In this case, each image should have an ASCII art equivalent to show the user.
An example will probably make things easier to
understand. Suppose you have an image, called
fig1.png, that you want to include in the
document. This image is of a rectangle with an A inside it.
The markup for this would be as follows.
</imageobject>
<textobject>
<literallayout class="monospaced">+---------------+
| A |
+---------------+</literallayout>
</textobject>
<textobject>
<phrase>A picture</phrase>
</textobject>
</mediaobject>Include an | |
The first Notice how the first and last lines of the content
of the | |
The second |
Your images must be listed in the
Makefile in the
IMAGES variable. This variable should
contain the name of all your source
images. For example, if you have created three figures,
fig1.eps,
fig2.png,
fig3.png, then your
Makefile should have lines like this in
it.
or
Again, the Makefile will work out
the complete list of images it needs to build your source
document, you only need to list the image files
you provided.
You must be careful when you separate your documentation into smaller files (see Section 3.7.1, “Using General Entities to Include Files”) in different directories.
Suppose you have a book with three chapters, and the
chapters are stored in their own directories, called
chapter1/chapter.xml,
chapter2/chapter.xml, and
chapter3/chapter.xml. If each chapter
has images associated with it, it is suggested to place
those images in each chapter's subdirectory
(chapter1/,
chapter2/, and
chapter3/).
However, if you do this you must include the directory
names in the IMAGES variable in the
Makefile, and you
must include the directory name in the
imagedata element in your
document.
For example, if you have
chapter1/fig1.png, then
chapter1/chapter.xml should
contain:
The Makefile must contain:
Then everything should just work.
Links are also in-line elements.
Linking within the same document requires you to specify where you are linking from (i.e., the text the user will click, or otherwise indicate, as the source of the link) and where you are linking to (the link's destination).
Each element within DocBook has an attribute called
id. You can place text in this attribute
to uniquely name the element it is attached to.
This value will be used when you specify the link source.
Normally, you will only be linking to chapters or
sections, so you would add the id
attribute to these elements.
id on Chapters and
SectionsObviously, you should use more descriptive values. The
values must be unique within the document (i.e., not just
the file, but the document the file might be included in as
well). Notice how the id for the
subsection is constructed by appending text to the
id of the chapter. This helps to ensure
that they are unique.
If you want to allow the user to jump into a specific
portion of the document (possibly in the middle of a
paragraph or an example), use anchor.
This element has no content, but takes an
id attribute.
anchorWhen you want to provide the user with a link they can
activate (probably by clicking) to go to a section of the
document that has an id attribute, you
can use either xref or
link.
Both of these elements have a linkend
attribute. The value of this attribute should be the value
that you have used in a id attribute (it
does not matter if that value has not yet occurred in your
document; this will work for forward links as well as
backward links).
If you use xref then you have no
control over the text of the link. It will be generated for
you.
xrefAssume that this fragment appears somewhere in a
document that includes the id
example:
The text of the link will be generated automatically, and will look like (emphasized text indicates the text that will be the link):
More information can be found in Chapter One.
More specific information can be found in the section called Sub-Sect 1.
Notice how the text from the link is derived from the section title or the chapter number.
This means that you cannot use
xref to link to an
id attribute on an
anchor element. The
anchor has no content, so the
xref cannot generate the text for the
link.
If you want to control the text of the link then use
link. This element wraps content, and
the content will be used for the link.
linkAssume that this fragment appears somewhere in a
document that includes the id
example.
This will generate the following (emphasized text indicates the text that will be the link):
More information can be found in the first chapter.
More specific information can be found in this section.
That last one is a bad example. Never use words like “this” or “here” as the source for the link. The reader will need to hunt around the surrounding context to see where the link is actually taking them.
You can use
link to include a link to an
id on an anchor
element, since the link content defines
the text that will be used for the link.
Linking to external documents is much simpler, as long
as you know the URL of the document you want to link to.
Use ulink. The url
attribute is the URL of the page that the link points to,
and the content of the element is the text that will be
displayed for the user to activate.
ulinkUse:
Appearance:
Of course, you could stop reading this document and go to the FreeBSD home page instead.
[2] A short history can be found under http://www.oasis-open.org/docbook/intro.shtml#d0e41.
[3] There are other types of list element in DocBook, but we are not concerned with those at the moment.
XML says nothing about how a document should be displayed to the user, or rendered on paper. To do that, various languages have been developed to describe stylesheets, including XSLT, XSL FO or CSS.
We use XSLT stylesheets to transform DocBook into XHTML and then we apply CSS formatting to XHTML pages. Currently, the printable output is rendered with legacy DSSSL stylesheets but this may probably change in the future.
Cascading Stylesheets (CSS) are a mechanism for attaching style information (font, weight, size, color, and so forth) to elements in an XHTML document without abusing XHTML to do so.
The FreeBSD DSSSL stylesheets include a reference to a
stylesheet, docbook.css, which is
expected to appear in the same directory as the XHTML files.
The project-wide CSS file is copied from
doc/share/misc/docbook.css when documents
are converted to XHTML, and is installed automatically.
The doc/ tree is organized in a
particular fashion, and the documents that are part of the FDP are
in turn organized in a particular fashion. The aim is to make it
simple to add new documentation into the tree and:
Make it easy to automate converting the document to other formats.
Promote consistency between the different documentation organizations, to make it easier to switch between working on different documents.
Make it easy to decide where in the tree new documentation should be placed.
In addition, the documentation tree has to accommodate documentation that could be in many different languages and in many different encodings. It is important that the structure of the documentation tree does not enforce any particular defaults or cultural preferences.
There are two types of directory under
doc/, each with very specific directory
names and meanings.
share/share/mk, while
the additional XML support files (such as the FreeBSD
extended DocBook DTD) are in
share/xml.lang.encoding/en_US.ISO8859-1/ and
zh_TW.Big5/. The names are long, but
by fully specifying the language and encoding we prevent any
future headaches should a translation team want to provide
the documentation in the same language but in more than one
encoding. This also completely isolates us from any
problems that might be caused by a switch to Unicode.These directories contain the documents themselves. The documentation is split into up to three more categories at this level, indicated by the different directory names.
articlesarticle (or equivalent). Reasonably
short, and broken up into sections. Normally only available
as one XHTML file.booksbook (or equivalent). Book length, and
broken up into chapters. Normally available as both one
large XHTML file (for people with fast connections, or who
want to print it easily from a browser) and as a collection
of linked, smaller files.manmann
directories, corresponding to the sections that have been
translated.Not every
directory will contain all of these directories. It depends on
how much translation has been accomplished by that translation
team.lang.encoding
This section contains specific notes about particular documents managed by the FDP.
The Handbook is written to comply with the FreeBSD DocBook extended DTD.
The Handbook is organized as a DocBook
book. It is then divided into
parts, each of which may contain several
chapters. chapters are
further subdivided into sections (sect1)
and subsections (sect2,
sect3) and so on.
There are a number of files and directories within the
handbook directory.
The Handbook's organization may change over time, and this document may lag in detailing the organizational changes. If you have any questions about how the Handbook is organized, please contact the FreeBSD documentation project mailing list.
The Makefile defines some
variables that affect how the XML source is converted to
other formats, and lists the various source files that
make up the Handbook. It then includes the standard
doc.project.mk file, to bring in the
rest of the code that handles converting documents from
one format to another.
This is the top level document in the Handbook. It contains the Handbook's DOCTYPE declaration, as well as the elements that describe the Handbook's structure.
book.xml uses parameter
entities to load in the files with the
.ent extension. These files
(described later) then define general
entities that are used throughout the rest of the
Handbook.
Each chapter in the Handbook is stored in a file
called chapter.xml in a separate
directory from the other chapters. Each directory is
named after the value of the id
attribute on the chapter
element.
For example, if one of the chapter files contains:
Then it will be called
chapter.xml in the
kernelconfig directory. In general,
the entire contents of the chapter will be held in this
file.
When the XHTML version of the Handbook is produced,
this will yield kernelconfig.html.
This is because of the id value, and is
not related to the name of the directory.
In earlier versions of the Handbook the files were
stored in the same directory as
book.xml, and named after the value
of the id attribute on the file's
chapter element. Now, it is possible
to include images in each chapter. Images for each
Handbook chapter are stored within share/images/books/handbook.
Note that localized version of these images should be
placed in the same directory as the XML sources for each
chapter. Namespace collisions would be inevitable, and it
is easier to work with several directories with a few
files in them than it is to work with one directory that
has many files in it.
A brief look will show that there are many directories
with individual chapter.xml files,
including basics/chapter.xml,
introduction/chapter.xml, and
printing/chapter.xml.
Chapters and/or directories should not be named in a fashion that reflects their ordering within the Handbook. This ordering might change as the content within the Handbook is reorganized; this sort of reorganization should not (generally) include the need to rename files (unless entire chapters are being promoted or demoted within the hierarchy).
Each chapter.xml file will not
be a complete XML document. In particular, they will not
have their own DOCTYPE lines at the start of the
files.
This is unfortunate as it makes it impossible to treat these as generic XML files and simply convert them to HTML, RTF, PS, and other formats in the same way the main Handbook is generated. This would force you to rebuild the Handbook every time you want to see the effect a change has had on just one chapter.
This chapter's main purpose is to clearly explain how the documentation build process is organized, and how to affect modifications to this process.
After you have finished reading this chapter you should:
Know what you need to build the FDP documentation, in addition to those mentioned in the XML tools chapter.
Be able to read and understand the
make instructions that are present
in each document's Makefiles, as well as
an overview of the doc.project.mk
includes.
Be able to customize the build process by using make variables and make targets.
Here are your tools. Use them every way you can.
The primary build tool you will need is make, but specifically Berkeley Make.
Package building is handled by FreeBSD's pkg_create. If you are not using FreeBSD, you will either have to live without packages, or compile the source yourself.
gzip is needed to create compressed versions of the document. bzip2 compression and zip archives are also supported. tar is supported, but package building demands it.
install is the default method to install the documentation. There are alternatives, however.
It is unlikely you will have any trouble finding these last two, they are mentioned for completeness only.
There are three main types of Makefiles
in the FreeBSD Documentation Project tree.
Subdirectory
Makefiles simply pass
commands to those directories below them.
Documentation
Makefiles describe the
document(s) that should be produced from this
directory.
Make
includes are the glue that perform the document
production, and are usually of the form
doc..xxx.mk
These Makefiles usually take the form
of:
In quick summary, the first four non-empty lines define
the make variables,
SUBDIR, COMPAT_SYMLINK,
and DOC_PREFIX.
The first SUBDIR statement, as well as
the COMPAT_SYMLINK statement, shows how to
assign a value to a variable, overriding any previous
value.
The second SUBDIR statement shows how a
value is appended to the current value of a variable. The
SUBDIR variable is now articles
books.
The DOC_PREFIX assignment shows how a
value is assigned to the variable, but only if it is not
already defined. This is useful if
DOC_PREFIX is not where this
Makefile thinks it is - the user can
override this and provide the correct value.
Now what does it all mean? SUBDIR
mentions which subdirectories below this one the build process
should pass any work on to.
COMPAT_SYMLINK is specific to
compatibility symlinks (amazingly enough) for languages to
their official encoding (doc/en would
point to en_US.ISO-8859-1).
DOC_PREFIX is the path to the root of
the FreeBSD Document Project tree. This is not always that
easy to find, and is also easily overridden, to allow for
flexibility. .CURDIR is a
make builtin variable with the path
to the current directory.
The final line includes the FreeBSD Documentation
Project's project-wide make system
file doc.project.mk which is the glue
which converts these variables into build instructions.
These Makefiles set a bunch of
make variables that describe how to
build the documentation contained in that directory.
Here is an example:
The MAINTAINER variable is a very
important one. This variable provides the ability to claim
ownership over a document in the FreeBSD Documentation
Project, whereby you gain the responsibility for maintaining
it.
DOC is the name (sans the
.xml extension) of the main document
created by this directory. SRCS lists all
the individual files that make up the document. This should
also include important files in which a change should result
in a rebuild.
FORMATS indicates the default formats
that should be built for this document.
INSTALL_COMPRESSED is the default list of
compression techniques that should be used in the document
build. INSTALL_ONLY_COMPRESS, empty by
default, should be non-empty if only compressed documents are
desired in the build.
We covered optional variable assignments in the previous section.
The DOC_PREFIX and include statements
should be familiar already.
This is best explained by inspection of the code. Here are the system include files:
doc.project.mk is the main project
include file, which includes all the following include
files, as necessary.
doc.subdir.mk handles traversing of
the document tree during the build and install
processes.
doc.install.mk provides variables
that affect ownership and installation of documents.
doc.docbook.mk is included if
DOCFORMAT is docbook
and DOC is set.
By inspection:
DOCFORMAT and
MAINTAINER are assigned default values,
if these are not set by the document make file.
PREFIX is the prefix under which the
documentation building tools
are installed. For normal package and port installation,
this is /usr/local.
PRI_LANG should be set to whatever
language and encoding is natural amongst users these
documents are being built for. US English is the
default.
PRI_LANG in no way affects what
documents can, or even will, be built. Its main use is
creating links to commonly referenced documents into the
FreeBSD documentation install root.
The .if defined(DOC) line is an
example of a make conditional
which, like in other programs, defines behavior if some
condition is true or if it is false.
defined is a function which returns
whether the variable given is defined or not.
.if ${DOCFORMAT} == "docbook", next,
tests whether the DOCFORMAT variable is
"docbook", and in this case, includes
doc.docbook.mk.
The two .endifs close the two above
conditionals, marking the end of their application.
This is too long to explain by inspection, you should be able to work it out with the knowledge gained from the previous chapters, and a little help given here.
SUBDIR is a list of
subdirectories that the build process should go further
down into.
ROOT_SYMLINKS is the name of
directories that should be linked to the document
install root from their actual locations, if the current
language is the primary language (specified by
PRI_LANG).
COMPAT_SYMLINK is described in
the
Subdirectory Makefile
section.
Dependencies are described by
tuples, where to build
target:
dependency1 dependency2
...target, you need to build the given
dependencies first.
After that descriptive tuple, instructions on how to build the target may be given, if the conversion process between the target and its dependencies are not previously defined, or if this particular conversion is not the same as the default conversion method.
A special dependency .USE defines
the equivalent of a macro.
In the above, _SUBDIRUSE is now
a macro which will execute the given commands when it is
listed as a dependency.
What sets this macro apart from other targets?
Basically, it is executed after the
instructions given in the build procedure it is listed as a
dependency to, and it does not adjust
.TARGET, which is the variable which
contains the name of the target currently being
built.
In the above, clean will use
the _SUBDIRUSE macro after it has
executed the instruction
rm -f ${CLEANFILES}. In effect, this
causes clean to go further and
further down the directory tree, deleting built files as it
goes down, not on the way back
up.
install and
package both go down the
directory tree calling the real versions of themselves
in the subdirectories
(realinstall and
realpackage
respectively).
clean removes files
created by the build process (and goes down the
directory tree too).
cleandir does the same, and
also removes the object directory, if any.
exists is another condition
function which returns true if the given file
exists.
empty returns true if the given
variable is empty.
target returns true if the given
target does not already exist.
.for provides a way to repeat a set
of instructions for each space-separated element in a
variable. It does this by assigning a variable to contain
the current element in the list being examined.
In the above, if SUBDIR is empty, no
action is taken; if it has one or more elements, the
instructions between .for and
.endfor would repeat for every element,
with entry being replaced with the value
of the current element.
Use a disk with sufficient free space. You may need anything from 200 MB to over 500 MB, depending on the method you choose. This space will hold the XML tools, a subset of the svn tree, temporary build space and the installed web pages.
Make sure your documentation ports are up to date! When in doubt, remove the old ports using pkg_delete(1) command before installing the port. For example, we currently depend on jade-1.2 and if you have installed jade-1.1, please do:
# pkg_delete jade-1.1svn is necessary to “check
out” the necessary files from the
doc/ Subversion repository.
svn can be installed with pkg_add(1)
or from the FreeBSD Ports Collection by running:
# cd /usr/ports/devel/subversion
# make install cleanTo check out the full source files for the FreeBSD website, run:
# svn checkout https://svn0.us-east.FreeBSD.org/doc/head/ /usr/buildsvn0.us-east.FreeBSD.org
is a public SVN server.
Select the closest mirror and verify the mirror server
certificate from the list of Subversion
mirror sites.
If svn is not run as
root, be sure /usr/build has the proper
permissions for the current user. If changing the
permissions is not possible, use a different target
directory for the website files.
When svn finishes, the current version
of the FreeBSD website will exist within /usr/build. If a different
target directory was used, replace /usr/build appropriately
throughout the remainder of this document.
That's it! You can now proceed with the website build.
Having completed the necessary steps to obtain the website
source files, the website can be built. In our example, the
build directory is
and all the required files are already in place./usr/build
Change into the build directory:
# cd /usr/buildThe website build starts from the en_US.ISO8859-1/htdocs
directory by executing the make(1)
all target, to create the web
pages.
# cd en_US.ISO8859-1/htdocs
# make allThe build requires a few files from the Ports Collection
and may fail without a properly configured Ports CVS
mirror. Set the NOPORTSCVS environment
variable as described in Section 8.4, “Environment Variables”
to use your local Ports Collection (typically /usr/ports) instead.
If you have moved out of the en_US.ISO8859-1/htdocs
directory, change back to it.
# cd /usr/build/en_US.ISO8859-1/htdocsRun the make(1) install
target, setting the DESTDIR variable to
the name of the directory you want to install the files to.
The actual files are installed under $DESTDIR/data
which should be configured as your web server's document
root.
# env DESTDIR=/usr/local/www make installIf you have previously installed the web pages into the same directory the install process will not have deleted any old or outdated pages. For example, if you build and install a new copy of the site every day, this command will find and delete all files that have not been updated in three days.
# find /usr/local/www -ctime 3 -print0 | xargs -0 rmENGLISH_ONLYIf set and not empty, the makefiles will build and install only the English documents. All translations will be ignored. E.g.:
# make ENGLISH_ONLY=YES all installIf you want to unset the variable
ENGLISH_ONLY and build all pages,
including translations, set the variable
ENGLISH_ONLY to an empty value:
# make ENGLISH_ONLY="" all install cleanWEB_ONLYIf set and not empty, the Makefiles will build and
install only the HTML pages from the en_US.ISO8859-1/htdocs
directory. All other directories within en_US.ISO8859-1
(Handbook, FAQ, Tutorials) will be ignored.
E.g.:
# make WEB_ONLY=YES all installWEB_LANGIf set, the Makefiles will build and install only for
the languages specified by this variable inside the
directory. All other languages except English will be
ignored. E.g.:/usr/build
# make WEB_LANG="el_GR.ISO8859-7 es_ES.ISO8859-1 hu_HU.ISO8859-2 nl_NL.ISO8859-1" all installNOPORTSCVSIf set, the Makefiles will not checkout files from the
ports CVS repository. Instead, it will copy the files
from /usr/ports (or
where the variable PORTSBASE points
to).
WEB_ONLY, WEB_LANG,
ENGLISH_ONLY and
NOPORTSCVS are make variables. You can set
the variables in /etc/make.conf,
Makefile.inc, as environment variables on
the command line, or in your dot files.
This is the FAQ for people translating the FreeBSD documentation (FAQ, Handbook, tutorials, manual pages, and others) to different languages.
It is very heavily based on the
translation FAQ from the FreeBSD German Documentation Project,
originally written by Frank Gründer
<elwood@mc5sys.in-berlin.de> and translated back to
English by Bernd Warken <bwarken@mayn.de>.
The FAQ is maintained by the Documentation Engineering Team <doceng@FreeBSD.org>.
9.1. | Why a FAQ? |
More and more people are approaching the freebsd-doc mailing list and volunteering to translate FreeBSD documentation to other languages. This FAQ aims to answer their questions so they can start translating documentation as quickly as possible. | |
9.2. | What do i18n and l10n mean? |
i18n means internationalization and l10n means localization. They are just a convenient shorthand. i18n can be read as “i” followed by 18 letters, followed by “n”. Similarly, l10n is “l” followed by 10 letters, followed by “n”. | |
9.3. | Is there a mailing list for translators? |
Yes. Different translation groups have their own mailing lists. The list of translation projects has more information about the mailing lists and web sites run by each translation project. | |
9.4. | Are more translators needed? |
Yes. The more people work on translation the faster it gets done, and the faster changes to the English documentation are mirrored in the translated documents. You do not have to be a professional translator to be able to help. | |
9.5. | What languages do I need to know? |
Ideally, you will have a good knowledge of written English, and obviously you will need to be fluent in the language you are translating to. English is not strictly necessary. For example, you could do a Hungarian translation of the FAQ from the Spanish translation. | |
9.6. | What software do I need to know? |
It is strongly recommended that you maintain a local copy of the FreeBSD Subversion repository (at least the documentation part). This can be done by running: % svn0.us-east.FreeBSD.org
is a public Note:This will require the You should be comfortable using svn. This will allow you to see what has changed between different versions of the files that make up the documentation. For example, to view the differences between revisions
% | |
9.7. | How do I find out who else might be translating to the same language? |
The Documentation Project translations page lists the translation efforts that are currently known about. If others are already working on translating documentation to your language, please do not duplicate their efforts. Instead, contact them to see how you can help. If no one is listed on that page as translating for your language, then send a message to the FreeBSD documentation project mailing list in case someone else is thinking of doing a translation, but has not announced it yet. | |
9.8. | No one else is translating to my language. What do I do? |
Congratulations, you have just started the
“FreeBSD First, decide whether or not you have got the time to spare. Since you are the only person working on your language at the moment it is going to be your responsibility to publicize your work and coordinate any volunteers that might want to help you. Write an email to the Documentation Project mailing list, announcing that you are going to translate the documentation, so the Documentation Project translations page can be maintained. If there is already someone in your country providing FreeBSD mirroring services you should contact them and ask if you can have some webspace for your project, and possibly an email address or mailing list services. Then pick a document and start translating. It is best to start with something fairly small—either the FAQ, or one of the tutorials. | |
9.9. | I have translated some documentation, where do I send it? |
That depends. If you are already working with a translation team (such as the Japanese team, or the German team) then they will have their own procedures for handling submitted documentation, and these will be outlined on their web pages. If you are the only person working on a particular language (or you are responsible for a translation project and want to submit your changes back to the FreeBSD project) then you should send your translation to the FreeBSD project (see the next question). | |
9.10. | I am the only person working on translating to this language, how do I submit my translation? or We are a translation team, and want to submit documentation that our members have translated for us. |
First, make sure your translation is organized properly. This means that it should drop into the existing documentation tree and build straight away. Currently, the FreeBSD documentation is stored in a top
level directory called If your language can be encoded in different ways (for example, Chinese) then there should be directories below this, one for each encoding format you have provided. Finally, you should have directories for each document. For example, a hypothetical Swedish translation might look like: head/
sv_SE.ISO8859-1/
Makefile
htdocs/
docproj/
books/
faq/
Makefile
book.xml
Use tar(1) and gzip(1) to compress up your documentation, and send it to the project. % cd doc
% tar cf swedish-docs.tar sv_SE.ISO8859-1
% gzip -9 swedish-docs.tarPut Either way, you should use send-pr(1) to submit a report indicating that you have submitted the documentation. It would be very helpful if you could get other people to look over your translation and double check it first, since it is unlikely that the person committing it will be fluent in the language. Someone (probably the Documentation Project Manager,
currently Documentation Engineering Team
If there are any problems then whoever is looking at the submission will get back to you to work them out. If there are no problems your translation will be committed as soon as possible. | |
9.11. | Can I include language or country specific text in my translation? |
We would prefer that you did not. For example, suppose that you are translating the Handbook to Korean, and want to include a section about retailers in Korea in your Handbook. There is no real reason why that information should not be in the English (or German, or Spanish, or Japanese, or …) versions as well. It is feasible that an English speaker in Korea might try to pick up a copy of FreeBSD whilst over there. It also helps increase FreeBSD's perceived presence around the globe, which is not a bad thing. If you have country specific information, please submit it as a change to the English Handbook (using send-pr(1)) and then translate the change back to your language in the translated Handbook. Thanks. | |
9.12. | How should language specific characters be included? |
Non-ASCII characters in the documentation should be included using SGML entities. Briefly, these look like an ampersand (&), the name of the entity, and a semi-colon (;). The entity names are defined in ISO8879, which is in the
ports tree as A few examples include: Entity: é Appearance: é Description: Small “e” with an acute accent Entity: É Appearance: É Description: Large “E” with an acute accent Entity: ü Appearance: ü Description: Small “u” with an umlaut After you have installed the iso8879 port, the files in
| |
9.13. | Addressing the reader |
In the English documents, the reader is addressed as “you”, there is no formal/informal distinction as there is in some languages. If you are translating to a language which does distinguish, use whichever form is typically used in other technical documentation in your language. If in doubt, use a mildly polite form. | |
9.14. | Do I need to include any additional information in my translations? |
Yes. The header of the English version of each document will look something like this: <!--
The FreeBSD Documentation Project
$FreeBSD: head/en_US.ISO8859-1/books/faq/book.xml 38674 2012-04-14 13:52:52Z $
--> The exact boilerplate may change, but it will always
include a $FreeBSD$ line and the phrase
Your translated documents should include their own
$FreeBSD$ line, and change the
In addition, you should add a third line which indicates which revision of the English text this is based on. So, the Spanish version of this file might start: <!--
The FreeBSD Spanish Documentation Project
$FreeBSD: head/es_ES.ISO8859-1/books/faq/book.xml 38826 2012-05-17 19:12:14Z hrs $
Original revision: r38674
--> |
In order to promote consistency between the myriad authors of the FreeBSD documentation, some guidelines have been drawn up for authors to follow.
There are several variants of English, with different spellings for the same word. Where spellings differ, use the American English variant. “color”, not “colour”, “rationalize”, not “rationalise”, and so on.
The use of British English may be accepted in the case of a contributed article, however the spelling must be consistent within the whole document. The other documents such as books, web site, manual pages, etc. will have to use American English.
Do not use contractions. Always spell the phrase out in full. “Don't use contractions” would be wrong.
Avoiding contractions makes for a more formal tone, is more precise, and is slightly easier for translators.
In a list of items within a paragraph, separate each item from the others with a comma. Separate the last item from the others with a comma and the word “and”.
For example, look at the following:
This is a list of one, two and three items.
Is this a list of three items, “one”, “two”, and “three”, or a list of two items, “one” and “two and three”?
It is better to be explicit and include a serial comma:
This is a list of one, two, and three items.
Try not to use redundant phrases. In particular, “the command”, “the file”, and “man command” are probably redundant.
These two examples show this for commands. The second example is preferred.
Use the command svn to update
your sources.
Use svn to update your
sources.
These two examples show this for filenames. The second example is preferred.
… in the filename
/etc/rc.local…
… in
/etc/rc.local…
These two examples show this for manual references. The
second example is preferred (the second example uses
citerefentry).
See man csh for more
information.
See csh(1).
Always use two spaces at the end of sentences, as this improves readability, and eases use of tools such as Emacs.
While it may be argued that a capital letter following
a period denotes a new sentence, this is not the case,
especially in name usage. “Jordan K. Hubbard”
is a good example; it has a capital H
following a period and a space, and there certainly is not a
new sentence there.
For more information about writing style, see Elements of Style, by William Strunk.
To keep the source for the documentation consistent when many different people are editing it, please follow these style conventions.
Tags are entered in lower case, para,
not PARA.
Text that appears in SGML contexts is generally written in
upper case, <!ENTITY…>, and
<!DOCTYPE…>,
not
<!entity…> and
<!doctype…>.
Acronyms should generally be spelled out the first time they appear in a document, as in: “Network Time Protocol (NTP)”. After the acronym has been defined, you should generally use the acronym only (not the whole term, unless it makes more sense contextually to use the whole term). Usually, acronyms are defined only one per document. But if you prefer, you can also define them the first time they appear in each chapter.
All acronyms should be enclosed in
acronym tags, with a
role attribute with the full term defined.
This allows a link to the glossary to be created, and for
mouseovers to be rendered with the fully expanded term.
Write in a formal style. Avoid addressing the reader
as “you”. For example, say
“copy the file to /tmp”
rather than “you can copy the file to
/tmp”.
Avoid weasel words like “should”, “might”, “try”, or “could”. These words imply that the speaker is unsure of the facts, and create doubt in the reader.
Give instructions as an imperative command: not “you should do this”, but merely “do this”.
Avoid flowery or embellished speech, jokes, or colloquial expressions. Write as simply and clearly as possible. Simple text is easier to understand and makes the job of translation easier.
Keep explanations as short, simple, and clear as possible. Avoid empty phrases like “in order to”, which usually just means “to”. Avoid potentially patronizing words like “basically”. Avoid Latin terms like “i.e.” or “cf.”, which may be unknown outside of academic or scientific groups.
Writing must be clear, complete, and concise. These goals can conflict with each other. Good writing consists of a balance between them.
Each file starts with indentation set at column 0, regardless of the indentation level of the file which might contain this one.
Opening tags increase the indentation level by 2 spaces. Closing tags decrease the indentation level by 2 spaces. Blocks of 8 spaces at the start of a line should be replaced with a tab. Do not use spaces in front of tabs, and do not add extraneous whitespace at the end of a line. Content within elements should be indented by two spaces if the content runs over more than one line.
For example, the source for this section looks something like:
If you use Emacs or
XEmacs to edit the files then
sgml-mode should be loaded automatically,
and the Emacs local variables at
the bottom of each file should enforce these styles.
Vim users might want to configure their editor with:
Tags that start at the same indent as a previous tag should be separated by a blank line, and those that are not at the same indent as a previous tag should not:
Tags like itemizedlist which will
always have further tags inside them, and in fact do not
take character data themselves, are always on a line by
themselves.
Tags like para and
term do not need other tags to contain
normal character data, and their contents begin immediately
after the tag, on the same line.
The same applies to when these two types of tags close.
This leads to an obvious problem when mixing these tags.
When a starting tag which cannot contain character data directly follows a tag of the type that requires other tags within it to use character data, they are on separate lines. The second tag should be properly indented.
When a tag which can contain character data closes directly after a tag which cannot contain character data closes, they co-exist on the same line.
When committing changes, do not commit changes to the content at the same time as changes to the formatting.
This is so that the teams that convert the documentation to other languages can quickly see what content has actually changed in your commit, without having to decide whether a line has changed because of the content, or just because it has been refilled.
For example, if you have added two sentences to a paragraph, such that the line lengths on the paragraph now go over 80 columns, first commit your change with the too-long line lengths. Then fix the line wrapping, and commit this second change. In the commit message for the second change, be sure to indicate that this is a whitespace-only change, and that the translation team can ignore it.
Avoid line breaks in places where they look ugly or make it difficult to follow a sentence. Line breaks depend on the width of the chosen output medium. In particular, viewing the HTML documentation with a text browser can lead to badly formatted paragraphs like the next one:
Data capacity ranges from 40 MB to 15 GB. Hardware compression …
The general entity prohibits
line breaks between parts belonging together. Use
non-breaking spaces in the following places:
between numbers and units:
between program names and version numbers:
between multiword names (use with caution when applying this to more than 3-4 word names like “The FreeBSD Brazilian Portuguese Documentation Project”):
This list of words shows the correct spelling and capitalization when used in FreeBSD Documentation. If a word is not on this list, ask about that word on the FreeBSD documentation project mailing list.
| Word | XML Code |
|---|---|
| CD-ROM | <acronym>CD-ROM</acronym> |
| DoS (Denial of Service) | <acronym>DoS</acronym> |
| file system | |
| IPsec | |
| Internet | |
| manual page | |
| mail server | |
| name server | |
| Ports Collection | |
| read-only | |
| Soft Updates | |
| UNIX® | &unix; |
| web server |
Recent versions of Emacs or
XEmacs (available from the Ports
Collection) contain a very useful package called PSGML (can be
installed from editors/psgml).
Automatically invoked when a file with the
.xml extension is loaded, or by typing
M-x sgml-mode, it is a major mode for dealing
with SGML files, elements and attributes.
An understanding of some of the commands provided by this mode can make working with SGML documents such as the Handbook much easier.
C-c C-eRuns sgml-insert-element. You will
be prompted for the name of the element to insert at the
current point. You can use the Tab key to
complete the element. Elements that are not valid at the
current point will be disallowed.
The start and end tags for the element will be inserted. If the element contains other, mandatory, elements then these will be inserted as well.
C-c =Runs sgml-change-element-name.
Place the point within an element and run this command. You
will be prompted for the name of the element to change to.
Both the start and end tags of the current element will be
changed to the new element.
C-c C-rRuns sgml-tag-region. Select some
text (move to start of text, C-space,
move to end of text, C-space) and then
run this command. You will be prompted for the element to
use. This element will then be inserted immediately before
and after your marked region.
C-c -Runs sgml-untag-element. Place the
point within the start or end tag of an element you want to
remove, and run this command. The element's start and end
tags will be removed.
C-c C-qRuns sgml-fill-element. Will
recursively fill (i.e., reformat) content from the current
element in. The filling will affect
content in which whitespace is significant, such as within
programlisting elements, so run this
command with care.
C-c C-aRuns sgml-edit-attributes. Opens a
second buffer containing a list of all the attributes for
the closest enclosing element, and their current values.
Use Tab to navigate between attributes,
C-k to remove an existing value and
replace it with a new one, C-c C-c to
close this buffer and return to the main document.
C-c C-vRuns sgml-validate. Prompts you to
save the current document (if necessary) and then runs an
SGML validator. The output from the validator is captured
into a new buffer, and you can then navigate from one
troublespot to the next, fixing markup errors as you
go.
C-c /Runs sgml-insert-end-tag. Inserts
the end tag for the current open element.
Doubtless there are other useful functions of this mode, but those are the ones I use most often.
You can also use the following entries in
.emacs to set proper spacing, indentation,
and column width for working with the Documentation
Project.
This document is deliberately not an exhaustive discussion of XML, the DTDs listed, and the FreeBSD Documentation Project. For more information about these, you are encouraged to see the following web sites.
The DocBook Technical Committee, maintainers of the DocBook DTD
DocBook: The Definitive Guide, the online documentation for the DocBook DTD
The DocBook Open Repository contains DSSSL stylesheets and other resources for people using DocBook
This appendix contains example XML files and command lines you can use to convert them from one output format to another. If you have successfully installed the Documentation Project tools then you should be able to use these examples directly.
These examples are not exhaustive—they do not contain
all the elements you might want to use, particularly in your
document's front matter. For more examples of DocBook markup you
should examine the XML source for this and other documents,
available in the svn
doc repository, or available online starting at
http://svnweb.FreeBSD.org/doc/.
To avoid confusion, these examples use the standard DocBook 4.1 DTD rather than the FreeBSD extension. They also use the stock stylesheets distributed by Norm Walsh, rather than any customizations made to those stylesheets by the FreeBSD Documentation Project. This makes them more useful as generic DocBook examples.
bookarticleThis section assumes that you have installed the software
listed in the textproc/docproj port, either by
hand, or by using the port. Further, it is assumed that your
software is installed in subdirectories under
/usr/local/, and the directory where
binaries have been installed is in your PATH.
Adjust the paths as necessary for your system.
% jade -V nochunks \
-c /usr/local/share/xml/docbook/dsssl/modular/catalog \
-c /usr/local/share/xml/docbook/catalog \
-c /usr/local/share/xml/jade/catalog \
-d /usr/local/share/xml/docbook/dsssl/modular/html/docbook.dsl \
-t sgml
file.xml > file.html 
Specifies the | |
Specifies the catalogs that Jade will need to process. Three catalogs are required. The first is a catalog that contains information about the DSSSL stylesheets. The second contains information about the DocBook DTD. The third contains information specific to Jade. | |
Specifies the full path to the DSSSL stylesheet that Jade will use when processing the document. | |
Instructs Jade to perform a transformation from one DTD to another. In this case, the input is being transformed from the DocBook DTD to the HTML DTD. | |
Specifies the file that
Jade should process, and
redirects output to the specified
|
% jade \
-c /usr/local/share/xml/docbook/dsssl/modular/catalog \
-c /usr/local/share/xml/docbook/catalog \
-c /usr/local/share/xml/jade/catalog \
-d /usr/local/share/xml/docbook/dsssl/modular/html/docbook.dsl \
-t sgml
file.xml 
Specifies the catalogs that Jade will need to process. Three catalogs are required. The first is a catalog that contains information about the DSSSL stylesheets. The second contains information about the DocBook DTD. The third contains information specific to Jade. | |
Specifies the full path to the DSSSL stylesheet that Jade will use when processing the document. | |
Instructs Jade to perform a transformation from one DTD to another. In this case, the input is being transformed from the DocBook DTD to the HTML DTD. | |
Specifies the file that Jade should process. The stylesheets determine how the individual HTML files will be named, and the name of the “root” file (i.e., the one that contains the start of the document. |
This example may still only generate one HTML file, depending on the structure of the document you are processing, and the stylesheet's rules for splitting output.
The source XML file must be converted to a TeX file.
% jade -V tex-backend \
-c /usr/local/share/xml/docbook/dsssl/modular/catalog \
-c /usr/local/share/xml/docbook/catalog \
-c /usr/local/share/xml/jade/catalog \
-d /usr/local/share/xml/docbook/dsssl/modular/print/docbook.dsl \
-t tex
file.xmlCustomizes the stylesheets to use various options specific to producing output for TeX. | |
Specifies the catalogs that Jade will need to process. Three catalogs are required. The first is a catalog that contains information about the DSSSL stylesheets. The second contains information about the DocBook DTD. The third contains information specific to Jade. | |
Specifies the full path to the DSSSL stylesheet that Jade will use when processing the document. | |
Instructs Jade to convert the output to TeX. |
The generated .tex file must now be
run through tex, specifying the
&jadetex macro package.
% tex "&jadetex" file.texYou have to run tex at
least three times. The first run processes the
document, and determines areas of the document which are
referenced from other parts of the document, for use in
indexing, and so on.
Do not be alarmed if you see warning messages such as LaTeX Warning: Reference `136' on page 5 undefined on input line 728. at this point.
The second run reprocesses the document now that certain pieces of information are known (such as the document's page length). This allows index entries and other cross-references to be fixed up.
The third pass performs any final cleanup necessary.
The output from this stage will be
.file.dvi
Finally, run dvips to convert the
.dvi file to Postscript.
% dvips -o file.ps file.dviThe first part of this process is identical to that when
converting DocBook to Postscript, using the same
jade command line (Example A.5, “Converting DocBook to Postscript”).
When the .tex file has been
generated you run pdfTeX.
However, use the &pdfjadetex macro
package instead.
% pdftex "&pdfjadetex" file.texAgain, run this command three times.
This will generate
,
which does not need to be processed any further.file.pdf