<inline-code> Inline Code

An intext container element for technical content (such as programming language code, pseudo-code, or a markup fragment) that is within the scope of a single line of narrative text.

Usage/Remarks

Inline Code versus Block Code
The <inline-code> element is similar to <code> in the preservation of whitespace, but this element is intended to be inline with narrative text and have no line breaks inside it. The <code> (Code Block) element differs from <inline-code> only in extent: The element <code> is used for block-level code fragments. The element <inline-code> is only for monospaced words or phrases that are inline with other text, for example, parameters and operators, very short computer code snippets, etc.
Although it is not enforceable with a grammar-base schema (DTD, XSD), an <inline-code> should never contain linebreaks, even though it preserves other whitespace. If you need to add a linebreak to an <inline-code> element, the element must also become a <code> element.

Best Attribute Practice

The various semantic attributes should be used to name the type of code, the language, the intended platform(s), etc. Executable code should always be marked as such using the @executable attribute. The @specific-use attribute may also be used to describe the rationale or uses for a code sample.
The <inline-code> element does take the @xml:space, set to “preserve” as a default.
The <inline-code> element does not take the @position or @orientation attributes (the way that the <code> element does) because it inherits these properties from the element that contains the line in which it is embedded.
MathML
The MathML elements to describe equations are not permitted within <inline-code>. If equations are encountered within computer code, they can be tagged using the element <named-content> to preserve the fact that they were equations or the element <styled-content> to preserve the fact that they were set in a math font.
Attributes

Base Attributes

Miscellaneous non-STS-specific Attributes

xml:space (default = preserve)
Models and Context
May be contained in
Description
Content Model
<!ELEMENT  inline-code  (#PCDATA %inline-code-elements;)*            >
Expanded Content Model

(#PCDATA | email | ext-link | uri | bold | fixed-case | italic | monospace | num | overline | roman | sans-serif | sc | strike | underline | ruby | inline-graphic | inline-media | private-char | abbrev | index-term | index-term-range-end | milestone-end | milestone-start | named-content | styled-content | fn | target | tbx:entailedTerm | xref | sub | sup)*