1. How swift-docc-render consumes this
Grepping src/components/ and src/views/ for the literal string
'inlineHead' lands entirely inside src/components/ContentNode.vue — there is
no dedicated InlineHead.vue component. The wire constant is declared in the inline-type
lookup table:
const InlineType = {
codeVoice: 'codeVoice',
emphasis: 'emphasis',
image: 'image',
inlineHead: 'inlineHead',
link: 'link',
newTerm: 'newTerm',
reference: 'reference',
strong: 'strong',
text: 'text',
superscript: 'superscript',
subscript: 'subscript',
strikethrough: 'strikethrough',
};
(ContentNode.vue#L56-L69.)
That constant is matched inside the renderNode() factory function's switch
(node.type) dispatch table, where it shares its case — verbatim, no distinguishing logic at all —
with the unrelated-by-name strong kind:
case InlineType.strong:
case InlineType.inlineHead:
return createElement('strong', (
renderChildren(node.inlineContent)
));
(ContentNode.vue#L488-L492.)
An inlineHead node is not delegated to any child Vue component — it is turned directly into
a bare native <strong> element via Vue's createElement render function,
with no props and no wrapper class, exactly as if it had been a strong node. The node's
inlineContent array is recursively rendered by the shared renderChildren
helper, which maps each child node back through the same renderNode() dispatcher
(ContentNode.vue#L121-L124).
The type discriminator itself is consumed only by the switch and never
forwarded into the DOM. There is no visual, semantic (no heading role, no aria-level), or
structural distinction on screen between an inlineHead node and a strong node —
despite the "Head" in its wire name suggesting a heading-like role, the renderer does not treat it as one.
ContentNode.vue also exposes tree-walking utility methods (map,
forEach, reduce) used elsewhere in the app to recurse over rendered content —
for example to build a plain-text index or to find/replace nodes.
InlineType.inlineHead appears in both of those switch tables purely so the walker knows to
recurse into node.inlineContent for this kind, alongside strong,
emphasis, superscript, subscript, strikethrough, and
newTerm
(ContentNode.vue#L564-L575
and
ContentNode.vue#L619-L628).
This is bookkeeping, not additional rendering behavior — the actual DOM output is fully determined by the
one shared createElement('strong', ...) call above.
2. Example JSON and rendered mockup
Real fixture: Tests/SwiftDocCTests/Rendering/Rendering Fixtures/custom-render-elements.json
in the swift-docc repository (pinned commit 8b8d8268aa), inside a paragraph's
inlineContent array, alongside a sibling newTerm node. No fixture inside
DocCArchive's own Tests/DocCArchiveTests/Fixtures/ archives (ExampleDocs.doccarchive,
SampleLibrary.doccarchive) contains an "inlineHead" RenderNode.
{
"type": "paragraph",
"inlineContent": [
{ "type": "text", "text": "Use " },
{
"type": "newTerm",
"inlineContent": [
{ "type": "text", "text": "www" }
]
},
{ "type": "text", "text": " and " },
{
"type": "inlineHead",
"inlineContent": [
{ "type": "text", "text": "ftp" }
]
},
{ "type": "text", "text": "." }
]
}
Use www and ftp.
mockup: the newTerm node ("www") and the inlineHead node ("ftp") are
both plain-text children of the same paragraph. newTerm is rendered elsewhere in
ContentNode.vue as a bare <em> (shown above in italics for contrast);
inlineHead renders as a bare <strong> — shown above in bold — with no
wrapper class, no heading semantics, and no visual distinction from an ordinary strong node
elsewhere on the same page.
3. Data sheet
Source: Sources/DocCArchive/Vendored/RenderNode.spec.json, schema object
#/components/schemas/InlineHead (lines 1352–1370), cross-checked against
Components.Schemas.InlineHead in Sources/DocCArchive/generated/Types.swift
(lines 1846–1872). InlineHead is one arm (.InlineHead) of the
RenderInlineContent discriminated union, decoded as an OpenAPI oneOf — the
generated initializer tries each candidate case's init(from:) in declaration order and keeps
the first one that decodes without throwing (Types.swift lines 1549 and 1597 show the
InlineHead case's position in that union's enum and decoder).
| Field | Type | Required | Enum values / default | Note |
|---|---|---|---|---|
type |
string | yes | "inlineHead" (single-value enum) |
Generated as _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { case inlineHead
= "inlineHead" }, decoded/encoded under the Swift property name _type via an explicit
CodingKeys mapping (case _type = "type"). |
inlineContent |
array of RenderInlineContent |
yes | — (no length constraint; may be empty) | Generated as [Components.Schemas.RenderInlineContent]. Holds the nested inline nodes
that receive whatever styling the renderer applies — structurally identical in shape to
Strong's and NewTerm's inlineContent field. |
Schema-shape note: InlineHead's object shape (a type discriminator plus one
inlineContent array) is byte-for-byte identical to Strong's and
NewTerm's — the three schemas differ only in their type enum's literal value.
Nothing in the JSON Schema itself hints that inlineHead is rendered identically to
strong rather than to some heading-like treatment; that behavior is a renderer-side decision
documented in Section 1, not a wire-format constraint.
On the swift-docc production side (secondary/flavor source, not authoritative for wire shape), the
enclosing enum case is case inlineHead(inlineContent: [RenderInlineContent])
(Sources/SwiftDocC/Model/Rendering/Content/RenderInlineContent.swift, line 50, within the
public enum RenderInlineContent: Equatable declared at line 32). The case-specific doc
comment is a single line: "An inline heading" (line 49) — the only place in swift-docc's source that
gives any hint of intended semantics for this case, and it is terser than the comments on neighboring
cases. Codable conformance is hand-written in the same file: the type computed property maps
.inlineHead to InlineType.inlineHead (line 80), and the
encode(to:)/init(from:) switch statements read/write inlineContent
under the shared coding key, matching the generated wire struct field-for-field.
RenderInlineContent+TextIndexing.swift confirms the same pattern used for indexing: a
.inlineHead(inlines) case simply forwards to
inlines.rawIndexableTextContent(references:) (lines 46–47), identically to how
.newTerm is handled one case above it (lines 44–45) — no special heading-level text
weighting is applied for search indexing either.
Authoring-side, this page cannot honestly cite a Markdown syntax or DocC directive that produces an
inlineHead node: a repository-wide search of
Sources/SwiftDocC/Model/Rendering/RenderContentCompiler.swift (swift-docc's
Markup-AST-to-RenderNode compiler, the file that contains visitStrong(_:) and
visitEmphasis(_:)) turns up no visitInlineHead method and no reference to
inlineHead at all. The only other places inlineHead/InlineHead
appear anywhere under Sources/SwiftDocC/ are the model enum case itself, its Codable
conformance, its text-indexing conformance, the vendored/authoritative copies of
RenderNode.spec.json, and a bare API-topics listing in
RenderInlineContent.md with no descriptive prose. That strongly suggests
inlineHead is a model/wire-format-only case with no current authoring-side entry point in
swift-docc's own Markdown compiler — it may be produced by a different or historical code path (or reserved
for future use), but this investigation found no evidence of one in the pinned commit.
DocCArchive's own transform layer does not yet do anything with this kind:
MyHTMLTransformer and MyMarkdownTransformer
(Sources/DocCArchive/DocCArchive.swift, lines 242–254) are still stub placeholders
that return a hardcoded HTML comment and an empty string respectively for an entire
RenderNode, with no per-inline-kind switch reached yet — so an inlineHead node
parsed via Components.Schemas.InlineHead is available on the decoded model today, but nothing
in this repository currently converts it into HTML or Markdown output.
4. HTML/CSS mapping in DocC-Render output
Rendered DOM for an inlineHead node, in context:
<strong>— the sole element produced; noid, noclass, nodata-*attribute, no heading role oraria-level. Its children are whateverrenderChildren(node.inlineContent)produces (plain text nodes, nested<em>, links, etc.).
No component-scoped SCSS targets inlineHead at all — ContentNode.vue has no
<style> block of its own, there is no
src/components/ContentNode/InlineHead.vue, and the rendered <strong>
element is indistinguishable in the DOM from one produced by an actual strong node. The only
project-wide rule that touches the native <strong> tag is a global typography default
in src/styles/base/_typography.scss:
b,
strong {
font-weight: $font-weight-semibold;
}
(_typography.scss#L158-L161.)
This overrides the browser's default font-weight: bold with the site's own
$font-weight-semibold Sass variable, so an inlineHead RenderNode renders at the
same consistent semibold weight as every literal strong/b element elsewhere in
the app. This is a compiled Sass constant, not a runtime CSS custom property, so it cannot be overridden
via ---prefixed theming variables the way many of DocC-render's color tokens can. No
heading-specific typography rule (font size, margin, letter-spacing) from
src/components/ContentNode/LinkableHeading.vue or its styles is reachable through this code
path — despite its wire name, inlineHead never touches heading CSS.
5. Modern CSS-only alternative
Not applicable
Current behavior in play: the inlineHead kind carries no interactive or stateful behavior at
all. ContentNode.vue's handling for it is a single, unconditional
createElement('strong', renderChildren(node.inlineContent)) call shared verbatim with the
strong case
(ContentNode.vue#L488-L492) —
no click handlers, no computed/reactive Vue state, no v-if/v-show branching, and
no JavaScript-driven visual state of any kind. The only styling involved is the static, non-conditional
font-weight override in _typography.scss (Section 4), which is already plain CSS
with nothing to migrate.
There is accordingly no state/behavior for a native HTML mechanism (<details>, radio +
:checked, :target, the Popover API, <dialog>,
:has(), container queries, anchor positioning, view transitions) to replace — this kind is a
pure, stateless text-formatting wrapper, rendered identically to strong. The verdict is "not
applicable" because there is nothing interactive here to reproduce, not because a modern CSS feature
happens to be a poor fit.