Programming elements
The programming domain elements are used to define the
syntax and to give examples of programming languages.
In this section:
- apiname
- codeblockThe <codeblock> element represents lines of program code. Like the <pre> element, line endings and spaces inside the element must be preserved, and the content is typically rendered in a monospaced font. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- coderefThe <coderef> element references an external file that contains literal code. When evaluated, the <coderef> element should cause the target code to be displayed inline. If the target contains non-XML characters such as '<' or '&', those will need to be handled in a way that they may be displayed correctly by the final rendering engine. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- codephThe 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.
- optionThe <option> element describes an option that can be used to modify a command (or something else, like a configuration). This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- parmnameWhen referencing the name of an application programming interface parameter within the text flow of your topic, use the parameter name (<parmname>) element to mark up the parameter. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- parmlThe parameter list (<parml>) element contains a list of terms and definitions that describes the parameters in an application programming interface. This is a special kind of definition list that is designed for documenting programming parameters. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- plentryThe parameter list entry element (<plentry>) contains one or more parameter terms and definitions (pt and pd). This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- ptA parameter term, within a parameter list entry, is enclosed by the <pt> element. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- pdA parameter definition, within a parameter list entry, is enclosed by the <pd> element. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- synphThe syntax phrase (<synph>) element is a container for syntax definition elements. It is used when a complete syntax diagram is not needed, but some of the syntax elements, such as kwd, oper, delim, are used within the text flow of the topic content. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- syntaxdiagramThe syntax diagram (<syntaxdiagram>) element is the main container for all the syntax elements that make up a syntax definition. The syntax diagram represents the syntax of a statement from a computer language or a command, function call, or programming language statement. Traditionally, the syntax diagram is formatted with
railroad tracks
that connect the units of the syntax together, but this presentation may differ depending on the output media. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information. - groupseqThe <groupseq> element is part of the subset of elements that define syntax diagrams in DITA. A group is a logical set of pieces of syntax that go together. Within the syntax definition, groups of keywords, delimiters and other syntax units act as a combined unit, and they occur in a specific sequence, as delimited by the <groupseq> element. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- groupchoiceThe <groupchoice> element is part of the subset of elements that define syntax diagrams in DITA. A group is a logical set of pieces of syntax that go together. A group choice specifies that the user must make a choice about which part of the syntax to use. Groups are often nested. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- groupcompThe <groupcomp> element is part of the subset of elements that define syntax diagrams in DITA. A group is a logical set of pieces of syntax that go together. The group composite means that the items that make up the syntax diagram will be formatted close together rather than being separated by a horizontal or vertical line, which is the usual formatting method. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- fragmentWithin a syntax definition, a <fragment> is a labeled subpart of the syntax. The <fragment> element allows breaking out logical chunks of a large syntax diagram into named fragments. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- fragrefThe fragment reference (<fragref>) element provides a logical reference to a syntax definition fragment so that you can reference a syntax fragment multiple times, or pull a large section of syntax out of line for easier reading. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- synblkThe syntax block (<synblk>) element organizes small pieces of a syntax definition into a larger piece. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- synnoteThe syntax note (<synnote>) element contains a note (similar to a footnote) within a syntax definition group or fragment. The syntax note explains aspects of the syntax that cannot be expressed in the markup itself. The note will appear at the bottom of the syntax diagram instead of at the bottom of the page. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- synnoterefThe syntax note (<synnoteref>) reference element references a syntax note element (<synnote>) that has already been defined elsewhere in the syntax diagram. The same notation can be used in more than one syntax definition. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- kwdThe <kwd> element defines a keyword within a syntax diagram. A keyword must be typed or output, either by the user or application, exactly as specified in the syntax definition. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- varWithin a syntax diagram, the <var> element defines a variable for which the user must supply content, such as their user name or password. Processors typically represent the <var> element in output in an italic font, but are not required to do so. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- operThe operator (<oper>) element defines an operator within a syntax definition. Typical operators are equals (=), plus (+) or multiply (*). This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- delimWithin a syntax diagram, the delimiter (<delim>) element defines a character marking the beginning or end of a section or part of the complete syntax. Typical delimiter characters are the parenthesis, comma, tab, vertical bar or other special characters. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- sepThe separator (<sep>) element defines a separator character that is inline with the content of a syntax diagram. The separator occurs between keywords, operators or groups in a syntax definition. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
- repsepThe repeat separator (<repsep>) element in a syntax diagram defines a group of syntax elements that can (or should) be repeated. If the <repsep> element contains a separator character, such as a plus (+), this indicates that the character must be used between repetitions of the syntax elements. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.
Previous topic: Task requirements domain
Next topic: Software elements
Parent topic: Domain elements