◇◆
<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 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
Miscellaneous non-STS-specific Attributes
xml:space (default = preserve)
Models and Context
May be contained in
<addr-line>, <aff>, <alternatives>, <alt-title>, <article-title>, <attrib>, <award-id>, <bold>, <chapter-title>, <chem-struct>, <code>, <collab>, <comment>, <compl>, <compound-kwd-part>, <compound-subject-part>, <copyright-statement>, <data-title>, <def-head>, <disp-formula>, <element-citation>, <ext-link>, <fixed-case>, <full>, <funding-source>, <inline-code>, <inline-formula>, <institution>, <intro>, <italic>, <kwd>, <label>, <license-p>, <main>, <meta-value>, <mixed-citation>, <monospace>, <named-content>, <nav-pointer>, <overline>, <p>, <part-title>, <preformat>, <publisher-loc>, <related-article>, <related-object>, <related-term>, <roman>, <sans-serif>, <sc>, <see>, <see-also>, <see-also-entry>, <see-entry>, <sig>, <sig-block>, <source>, <std>, <strike>, <styled-content>, <sub>, <subject>, <subtitle>, <sup>, <supplement>, <target>, <tbx:crossReference>, <tbx:definition>, <tbx:entailedTerm>, <tbx:example>, <tbx:externalCrossReference>, <tbx:note>, <tbx:pronunciation>, <tbx:see>, <tbx:source>, <tbx:term>, <tbx:usageNote>, <td>, <term>, <term-display-string>, <term-head>, <term-source>, <textual-form>, <th>, <title>, <trans-source>, <trans-subtitle>, <trans-title>, <underline>, <verse-line>, <xref>
Description
Any combination of:
- Text, numbers, or special characters
- External Linking Elements
- Emphasis Elements
- Inline Display Elements
- Other Inline Elements
- <fn> Footnote
- <target> Target of an Internal Link
- <tbx:entailedTerm> Entailed Term (TBX)
- <xref> X(cross) Reference
- Baseline Change Elements
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-code | 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)*