Appendix A contains the complete DTD specification. The DTD is also available in the Developer's Toolkit. It is located in the /usr/dt/dthelp/dthelptag/dtd
directory and is named helptag.dtd.
The syntax of an element declaration is:
Where:<ELEMENT element_type minimization (content model) >
head
is <head>
.
<chaphead>
followed by text. A chapter can contain zero or more s1
elements followed by zero or more rsect
elements.
<!ELEMENT chapter - - (chaphead, text, (s1*, rsect*)) >
chaphead
requires a head followed by an optional abbrev
. A chaphead
cannot contain these elements: memo,location,
or idx
.
<!ELEMENT chaphead - - (head, abbrev?) -(memo | location | idx) >
partext
element. newline
elements can be used within p
or any of the elements it contains.
<!ELEMENT p - - (head?, partext) +(newline) >
note
contains text. It can have an optional head. A note
cannot contain these elements: note,
caution,
or warning
.
<!ELEMENT note - - (head?, text) -(note | caution | warning) >
list
may contain an optional head. It requires at least one item, which can be repeated.
<!ELEMENT list - - (head?, item+) >
book
element declaration uses an exclusion to specify that it cannot contain another book
element.
<!ELEMENT book - - (partext) -(book) >
EMPTY, CDATA,
and #PCDATA
.
EMPTY
newline
and xref
elements are examples.
CDATA
#PCDATA
For example, a<!ATTLIST element_type attribute_values default_value>
list
element has four attributes: type,
ordertype, spacing,
and continue
. Values for each type are declared. The last column shows the default values. Because only one value exists for the continue
attribute, a default value is omitted.
This markup creates a numbered list (uppercase alphabet) that supplies extra spacing between list items.<!ATTLIST list type ( order bullet plain check ) bullet ordertype ( ualpha lalpha arabic uroman lroman ) arabic spacing ( tight loose ) tight continue (continue) #IMPLIED >
<list order ualpha loose> <item> <text> <p> <partext>Introducing the Front Panel></partext> </p> </text> </item>
See the section "Write Help Topics with HelpTag" for a description of shorthand and formal markup, and structured editors.
Notice the additional tags,<chaphead> <head> <partext>Front Panel Help</partext> </head> </chaphead>
<head>
and <partext>
; these are subcomponents of the <chaphead>
element. Each of these elements requires an explicit start and end tag.helpvolume>
is a container for every other element.
To decide what markup is necessary to create a help topic, you need to become familiar with the rules. For example, suppose you want to create a chapter. First, look at the declaration for chapter
listed below. It specifies that a chaphead
is required. Next, look at the rules for chaphead
. It, in turn, requires a head
. Consequently, look at the declaration for head
, and continue until you have reached the last nested element--in this case, partext
. Until you are familiar with the elements you commonly use, this approach will help you enter markup correctly.
Using a structured editor minimizes what an author needs to know about the DTD. The editor application "reads" the DTD and creates each element's required tags, many of which are intermediate structural tags.<!ELEMENT chapter - - (chaphead, text?, (s1*, rsect*)) > <!ELEMENT chaphead - - (head, abbrev?) -(memo | location | idx | footnote) > <!ELEMENT head - - (partext) -(memo | location | idx)> <!ELEMENT partext - - ((#PCDATA . . . ))>
Indentation is used in this example to make it easier to read the text and corresponding element tags.
<s2 id="TOOPENANEXISTINGDOCUMENT"> <chaphead><head> <partext>To Open an Existing Document</partext> </head></chaphead> <text> <p> <partext>You can use Text Editor or File Manager to open an existing document. </partext></p> <idx><indexprimary> <partext>document</partext></indexprimary> <indexsub> <partext>opening</partext></indexsub></idx> <idx><indexprimary> <partext>opening</partext></indexprimary> <indexsub> <partext>existing document</partext></indexsub></idx> <procedure> <chaphead><head> <partext>From Text Editor</partext> </head></chaphead> <text> <list type="ORDER"> <item><text><p> <partext>Choose Open from the File menu.</partext></p> <p> <partext>The Open a File dialog box lists files and folders on your system.You can browse the documents listed, or change to a new folder to locate other files on your system.</partext> </p></text></item> <item><text><p> <partext>Select the document you want to open in the Files list or type the file name in the Open a File field.</partext></p> <p> <partext><emph><partext>Or,</partext></emph> if the document is not in the current folder, first change to the folder that contains your document. Then choose a name in the Folders list or type the path name of the folder you wish to change to in the Enter path or folder name field.</partext></p></text></item> <item><text><p> <partext>Press Return or click OK. </partext></p></text></item></list> <figure tonumber="NONUMBER" entity="TEXTEDITOROPENFILE"> </figure></text></procedure> <procedure><chaphead><head> <partext>From File Manager</partext> </head></chaphead> <idx><indexprimary> <partext>opening</partext></indexprimary> <indexsub> <partext>document from File Manager</partext></indexsub></idx> <idx><indexprimary> <partext>document</partext></indexprimary> <indexsub> <partext>opening from File Manager</partext></indexsub></idx> <idx><indexprimary> <partext>File Manager</partext></indexprimary> <indexsub> <partext>opening document</partext></indexsub></idx> <text> <list type="BULLET"> <item><text><p> <partext>Display the document's file icon in a File Manager window.</partext> </p></text></item> <item><text><p> <partext>Do <emph><partext>one</partext></emph> of the following:</partext></p> <list type="BULLET"> <item><text><p> <partext>Double-click the document's file icon.</partext> </p></text></item> <item><text><p> <partext>Select the document, then choose Open from the Selected menu.</partext> </p></text></item> <item><text><p> <partext>Drag the document to Text Editor's control in the Front Panel.</partext> </p></text></item></list></text> </item></list><text> </procedure> <procedure><chaphead><head> <partext>See Also</partext> </head></chaphead> <text> <list type="BULLET" spacing="TIGHT"> <item><text><p> <partext><xref id="ENTERINGANDEDITINGTEXT"></partext> </p></text></item> <item><text><p> <partext><xref id="TOSAVEADOCUMENTTOTHECURRENTFILE"></partext> </p></text></item> <item><text><p> <partext><xref id="TABLEOFCONTENTS"></partext> </p></text></item></list></text> </procedure></text></s2>
Where entityname is the name of the entity and filename is the name of the file. The keyword<!entity entityname SYSTEM "filename">
SYSTEM
is required.
FILE
parameter with SYSTEM
.
Entities are referenced in formal markup exactly as they are in shorthand markup.<!entity MetaInformation SYSTEM "metainfo>" <!entity BasicTasks SYSTEM "basics"> <!entity AdvancedFeatures SYSTEM "advanced"> <!entity process_diagram SYSTEM "process.tif">
dthelptag
, you must use the formal
command-line option. For example, to process a formal markup file named Icons.ctg
in verbose mode, enter this command:
dthelptag -verbose -formal Icons.ctg
dthelptag
is always volume.sdl
. The online format is identical whether you used shorthand or formal markup.