The code phrase (<codeph>) element represents a snippet of code within the main flow of text. The code phrase is displayed in a monospaced font for emphasis. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
NoteThese models represent only the default document types distributed by OASIS.
Actual content models will differ with each new document type.
|
| Doctype | Content model |
|---|---|
| topic (technical content), map (technical content), concept, ditabase, glossary, glossentry, glossgroup, reference, task, bookmap | ( text data or boolean or cite or keyword or apiname or option or parmname or cmdname or msgnum or varname or wintitle or ph or b or i or sup or sub or tt or u or codeph or synph or filepath or msgph or systemoutput or userinput or menucascade or uicontrol or q or term or abbreviated-form or xref or state or data or data-about or foreign or unknown) (any number) |
<p>The second line of the sample program code, <codeph>Do forever</codeph>, represents the start of a loop construct.</p>
| Name | Description | Data Type | Default Value | Required? |
|---|---|---|---|---|
| univ-atts attribute group (includes select-atts, id-atts, and localization-atts groups) | A set of related attributes, described in univ-atts attribute group | |||
| global-atts attribute group (xtrf, xtrc) | A set of related attributes, described in global-atts attribute group | |||
| class, outputclass | Common attributes described in Other common DITA attributes |
‣ Parent topic: Section 2.6.2. Programming elements
‣ Previous topic: Section 2.6.2.3. coderef