1. How swift-docc-render consumes this
This is one of the "primary content" section kinds attached to a symbol's primaryContentSections
array — specifically the one used for documenting a property-list key or entitlement key (for example, an
Info.plist key or a .entitlements key). The dispatch happens in
PrimaryContent.vue,
which keys a lookup table on section.kind via the SectionKind constant map (defined in
constants/PrimaryContentSection.js,
where details: 'details' is the literal wire value). For SectionKind.details it selects
the PropertyListKeyDetails component and passes through the section's details object as
a prop:
componentFor(section) {
return {
...
[SectionKind.details]: PropertyListKeyDetails,
...
}[section.kind];
},
propsFor(section) {
const { ..., details, ... } = section;
return {
...
[SectionKind.details]: { details },
...
}[kind];
},
The actual rendering happens in
PropertyListKeyDetails.vue.
Its template root is a <section class="details"> containing a heading (via the shared
LinkableHeading component, anchored to "details" per
ContentSectionAnchors.js)
followed by a single definition list (<dl>) that conditionally emits up to three key/value pairs
depending on the details.titleStyle field:
<section class="details">
<LinkableHeading :anchor="contentSectionData.anchor">
{{ $t(contentSectionData.title) }}
</LinkableHeading>
<dl>
<template v-if="isSymbol">
<dt class="detail-type">{{ $t('metadata.details.name') }}</dt>
<dd class="detail-content">{{ details.ideTitle }}</dd>
</template>
<template v-if="isTitle">
<dt class="detail-type">{{ $t('metadata.details.key') }}</dt>
<dd class="detail-content">{{ details.name }}</dd>
</template>
<dt class="detail-type">{{ $t('metadata.details.type') }}</dt>
<dd class="detail-content">
<PropertyListKeyType :types="details.value" />
</dd>
</dl>
</section>
The isSymbol/isTitle computed properties read details.titleStyle
("symbol" vs. "title") together with the presence of details.ideTitle to
decide which extra row to show: when the raw key itself is the displayed title (titleStyle === 'symbol'),
it shows a "Name" row with the human-friendly ideTitle; when a friendly display name is the title
instead (titleStyle === 'title'), it shows a "Key" row with the raw details.name. The
"Type" row always renders, delegating to a small child component,
PropertyListKeyType.vue,
which turns the value array of { baseType, arrayMode } objects into an English phrase
such as "array of strings or a number" (joining with commas and a trailing "or", and pluralizing
baseType when arrayMode is true).
See also: Localization fallback — how $t()/locale-key lookup works across every kind that uses it.
2. Example JSON and rendered mockup
Real fixture: swift-docc's test suite includes a full rendered plist-key RenderNode fixture at
Tests/SwiftDocCTests/Rendering/Rendering Fixtures/plist-symbol.json (lines 84–101), used by
PlistSymbolTests.swift. The excerpt below is that fixture's details section, unmodified.
{
"kind": "details",
"title": "Details",
"details": {
"name": "com.apple.developer.networking.wifi",
"value": [
{
"baseType": "string",
"arrayMode": true
},
{
"baseType": "number"
}
],
"platforms": ["iOS", "macOS"],
"ideTitle": "WiFi access",
"titleStyle": "title"
}
}
- Key
- com.apple.developer.networking.wifi
- Type
- array of strings or a number
Because titleStyle is "title" here, the mockup shows a "Key" row holding the raw
name (the symbol's displayed title is presumably the friendlier ideTitle, "WiFi access",
shown elsewhere on the page as the page heading — not repeated inside this section). The platforms
array from the fixture is not rendered by PropertyListKeyDetails.vue at all; see the data sheet below.
3. Data sheet
Per Sources/DocCArchive/Vendored/RenderNode.spec.json, schema object DetailsRenderSection
(lines 2956–2975) plus its nested DetailsSection object (lines 2976–3011) and the shared
TypeDetails object (lines 3225–3238). Cross-checked against the generated
Components.Schemas.DetailsRenderSection struct in Sources/DocCArchive/generated/Types.swift
(lines 6628–6660), its nested Components.Schemas.DetailsSection (lines 6661–6712), and
Components.Schemas.TypeDetails (lines 7057–7079).
| Field | Type | Required? | Enum values / default | Note |
|---|---|---|---|---|
kind | string | yes | ["details"] (single-value enum) | Discriminator value; matches RenderSectionKind.plistDetails in swift-docc's Swift model (case plistDetails = "details"). |
title | string | yes | — | swift-docc's PropertyListDetailsRenderSection defaults this to "Details" and the translator never overrides it; the Vue component also supplies its own localized heading text (sections.details → "Details") rather than reading this field, so in practice it is redundant on the wire. |
details | DetailsSection object | yes | — | The single property-list-key description; unlike some sibling section kinds this is one object, not an array. |
DetailsSection.name | string | yes | — | The raw property-list key (e.g. "com.apple.developer.networking.wifi"). Wire key is name; swift-docc's Swift model calls the equivalent field rawKey via a custom CodingKeys mapping (case rawKey = "name"). |
DetailsSection.value | array of TypeDetails | yes | — | Acceptable value type(s) for this key; usually one entry, but can list several (e.g. "string or number"). |
DetailsSection.platforms | array of string | yes | — | Platform names the key applies to (e.g. ["iOS", "macOS"]). Present on the wire and required by the schema, but not read by PropertyListKeyDetails.vue — no platform information is rendered in this section as of the pinned commit. |
DetailsSection.ideTitle | string | no | — | Optional human-friendly display name for the key (e.g. "WiFi access"). Wire key is ideTitle; swift-docc's Swift model calls the equivalent field displayName via case displayName = "ideTitle". Shown as the "Name" row only when titleStyle == "symbol". |
DetailsSection.rawName | string | no | — | Present in the JSON Schema and generated Swift type but has no corresponding field in swift-docc's own PropertyListDetailsRenderSection.Details struct and is not read anywhere in PropertyListKeyDetails.vue. Appears to be vestigial/unused on both the producer and consumer sides as of the pinned commits. |
DetailsSection.titleStyle | string | yes | ["title", "symbol"] | Controls which extra row the Vue component shows (see section 1). Matches swift-docc's PropertyListTitleStyle enum (useRawKey = "symbol", useDisplayName = "title"). |
TypeDetails.baseType | string, nullable | no | — | e.g. "string", "number", "boolean", "array", "dictionary"; free-text on the wire, but PropertyListKeyType.vue only special-cases "array", "number", "string", and "dictionary" for pluralization, defaulting unrecognized/absent values to "*" for display. |
TypeDetails.arrayMode | boolean, nullable | no | — | When true, the type is rendered as "array of <baseType>s" instead of the bare base type. |
Source-of-truth alignment: swift-docc's own Swift model for this section lives at
Sources/SwiftDocC/Model/Rendering/Symbol/PropertyListDetailsRenderSection.swift (lines 27–70),
defining public struct PropertyListDetailsRenderSection: RenderSection, Equatable with a nested
Details struct. The struct's field names (rawKey, value, platforms,
displayName, titleStyle) differ cosmetically from the vendored JSON Schema/generated Swift
names (name, value, platforms, ideTitle, titleStyle)
purely via CodingKeys remapping — the wire JSON is identical either way. The rawName field
noted above is the one field present on the wire schema with no corresponding Swift-model property at all.
4. HTML/CSS mapping in DocC-Render output
<section class="details">— root element, scoped styles live entirely inline inPropertyListKeyDetails.vue's own<style scoped lang="scss">block (there is no separate dedicated SCSS partial for this kind).- Heading — rendered by the shared
LinkableHeadingcomponent (src/components/ContentNode/LinkableHeading.vue) as an<h2>(perContentSectionAnchors.js'slevel: 2forSectionKind.details), withid="details"set from theanchorprop, enabling deep-linking such as#details. <dl>— the key/value list; no dedicated class.<dt class="detail-type">— the localized row label ("Name", "Key", or "Type"); styled withfont-weight: $font-weight-semibold,padding-left: 1rem, andpadding-top: var(--spacing-param)(collapsed to0for the first item via&:first-child).<dd class="detail-content">— the row's value (plain text, or the nested<div class="type">fromPropertyListKeyType.vuefor the Type row); styled withpadding-left: 2rem.- Responsive behavior: at the
smallbreakpoint (mixin@include breakpoint(small)from the shareddocc-render/styles/_core.scssimport), the left padding on both.detail-typeand.detail-contentcollapses to0. PropertyListKeyType.vuecontributes its own tiny scoped rule:.type::first-letter { text-transform: capitalize; }, capitalizing the first letter of the generated English type phrase.- CSS custom property consumed:
--spacing-param, declared globally insrc/styles/base/_typography.scss(--spacing-param: #{rem(28px)}) and overridden per-view inDocumentationTopic.vue's root style block to track the surrounding topic page's stacked-content spacing scale. - SCSS files involved:
PropertyListKeyDetails.vue's own scoped block,PropertyListKeyType.vue's own scoped block, and the shareddocc-render/styles/_core.scssimport (for the breakpoint mixin and font-weight variable).
5. Modern CSS-only alternative
Not applicable
Current behavior: PropertyListKeyDetails.vue holds no component-local reactive state and has no
click/toggle/expand-collapse handlers. It is a one-way template render: two computed properties
(isSymbol, isTitle) derive a boolean directly from the immutable
details.titleStyle/details.ideTitle props passed down from the parent, and
v-if uses those booleans to decide, at render time, which of two mutually exclusive rows to include.
This is conceptually a compile-time/data-driven conditional, not a runtime UI toggle a user can flip — there is no
user interaction anywhere in this component (no click handler, no v-model, no v-show
tied to a click). PropertyListKeyType.vue is likewise a pure, stateless string-formatting computed
chain with no interactivity.
Because there is no interactive state to reproduce (no expand/collapse, no active/inactive selection, no
show/hide driven by user input), none of the native state-holding mechanisms
(<details>/<summary>, radio+:checked, :target, the
Popover API, <dialog>, :has(), container queries, CSS anchor positioning,
view-transitions) have anything to hold or replace for this kind. The one piece of "state" on the page — which
of the two conditional rows is shown — is fully determined by the server-rendered JSON payload before the page
ever reaches the browser, so it is not something CSS (native or otherwise) would ever need to manage.