1. How swift-docc-render consumes this
overview is one of three kind values (overview,
project, article) accepted by the TutorialsPageRenderNode
schema — the top-level RenderNode kind emitted for a Tutorial table of contents page
(what an author writes as a @Tutorials directive; see section 3). Unlike the
block/inline dispatch table in ContentNode.vue, or the section-level dispatch tables
used inside a page (e.g. Tutorial.vue's SectionComponents map), there is
no JS lookup table anywhere in swift-docc-render keyed on the literal string
node.kind === "overview". A real search of
src/components/ and src/views/ for the literal "overview"
token turns up plenty of hits, but they are all either the CSS custom-property namespace
(--color-tutorials-overview-*) or the component/file name TutorialsOverview
— never a kind string comparison.
Instead, dispatch happens one layer up, at the Vue Router level, based on URL shape. In
routes.js,
the route /tutorials/:id (a tutorials-technology root URL, with no further path segments)
is wired directly to the TutorialsOverview view component, while
/tutorials/:id/* (any tutorial or tutorial-article page nested under it) goes to
Topic.vue instead:
export const pagesRoutes = [
{
path: '/tutorials/:id',
name: 'tutorials-overview',
component: () => import(/* ... */ 'theme/views/TutorialsOverview.vue'),
},
{
path: '/tutorials/:id/*',
name: 'topic',
component: () => import(/* ... */ 'theme/views/Topic.vue'),
},
// ...
];
The route-level view,
views/TutorialsOverview.vue,
fetches the RenderNode JSON for the current route and passes exactly three of its top-level fields
(metadata, references, sections) straight through as props
to the actual presentational component,
components/TutorialsOverview.vue
(imported under the local name Overview):
<template>
<Overview v-if="topicData" v-bind="overviewProps" :key="topicKey" />
</template>
...
overviewProps: ({ topicData: { metadata, references, sections } }) => ({
metadata, references, sections,
}),
components/TutorialsOverview.vue partitions the top-level sections array
by section kind (not the page's own kind: "overview", which it never inspects)
into a single hero section and everything else:
const SectionKind = { hero: 'hero', resources: 'resources', volume: 'volume' };
...
partitionedSections: ({ sections }) => sections.reduce(([heroes, others], section) => (
section.kind === SectionKind.hero
? [heroes.concat(section), others]
: [heroes, others.concat(section)]
), [[], []]),
heroSection: ({ heroSections }) => heroSections[0],
Its template renders a dark-themed Nav, then, inside main#app-main, a
Hero (see the dedicated hero section-kind page for that subtree) fed the
first hero section plus metadata.estimatedTime, followed by a
LearningPath that receives all of the non-hero sections:
<div class="tutorials-overview">
<Nav v-if="!isTargetIDE" :sections="otherSections" class="theme-dark">{{ title }}</Nav>
<main id="app-main" tabindex="0" class="main">
<div class="radial-gradient">
<Hero v-if="heroSection" :action="heroSection.action" :content="heroSection.content"
:estimatedTime="metadata.estimatedTime" :image="heroSection.image"
:title="heroSection.title" />
</div>
<LearningPath v-if="otherSections.length > 0" :sections="otherSections" />
</main>
</div>
TutorialsOverview/LearningPath.vue
runs a second kind-keyed dispatch, this time a real lookup table, splitting its own
sections prop into volume-kind items (rendered via a dedicated
Volume component in a loop) and everything else (resources, dispatched
through a componentFor/propsFor pair):
const SectionKind = { resources: 'resources', volume: 'volume' };
...
componentFor: ({ kind }) => ({
[SectionKind.resources]: Resources,
[SectionKind.volume]: Volume,
}[kind]),
Volume is
TutorialsOverview/Volume.vue,
which renders an optional VolumeName plus one Chapter per
chapters[] entry (each chapter lists its tutorials topic references, looked
up against the page's references map). In summary: the page-level
kind: "overview" string is consumed entirely at the routing layer (URL shape decides
that this JSON is a tutorials-overview page and therefore selects this view chain) rather than
anywhere inside the Vue component tree via an explicit string comparison — the components
below the route simply trust the shape of sections/metadata they were
handed.
See also: The references map — how this and every other reference-dictionary lookup works across kinds.
2. Example JSON and rendered mockup
Neither DocCArchive's own fixtures (ExampleDocs.doccarchive,
SampleLibrary.doccarchive under Tests/DocCArchiveTests/Fixtures/) nor
swift-docc's test suite (grepped for "kind": "overview" and its variants across
Tests/SwiftDocCTests/ and Tests/DocCCommandLineTests/) contain a full
top-level RenderNode JSON literal for a kind: "overview" page. DocCArchive's fixture
archives were generated from a plain library/article project with no .tutorial
content, so they have no data/tutorials/ directory at all — the string
"overview" only turns up there inside minified bundle filenames/JS
(js/tutorials-overview.9144a669.js, css/tutorials-overview.9c2b2457.css).
swift-docc's tests reference RenderNode.Kind.overview as a Swift enum case
(e.g. ConvertActionTests.swift) and IndexingRecord.Kind.overview (a
different, unrelated enum used for full-text search records), but neither test file inlines the
resulting RenderNode JSON. The example below was therefore hand-written to be schema-valid against
the data sheet in section 3, shaped directly from the translator that produces it,
RenderNodeTranslator.visitTutorialTableOfContents(_:) in swift-docc
(Sources/SwiftDocC/Model/Rendering/RenderNodeTranslator.swift, lines 404–442 at
the pinned commit).
{
"schemaVersion": { "major": 0, "minor": 3, "patch": 0 },
"kind": "overview",
"identifier": {
"url": "doc://org.swift.docc.example/tutorials/TechnologyX",
"interfaceLanguage": "swift"
},
"hierarchy": {
"reference": "doc://org.swift.docc.example/tutorials/TechnologyX",
"modules": []
},
"metadata": {
"category": "TechnologyX",
"categoryPathComponent": "TechnologyX"
},
"sections": [
{
"kind": "hero",
"title": "Introducing TechnologyX",
"content": [
{
"type": "paragraph",
"inlineContent": [
{ "type": "text", "text": "Learn how to use TechnologyX." }
]
}
]
},
{
"kind": "volume",
"name": "Getting Started",
"chapters": [
{
"name": "Essentials",
"content": [
{
"type": "paragraph",
"inlineContent": [
{ "type": "text", "text": "Start here." }
]
}
],
"tutorials": [
"doc://org.swift.docc.example/tutorials/TechnologyX/Tutorial"
]
}
]
},
{
"kind": "resources",
"tiles": [
{
"identifier": "documentation",
"title": "Documentation",
"content": [
{
"type": "paragraph",
"inlineContent": [
{ "type": "text", "text": "Browse the API reference." }
]
}
]
}
]
}
],
"references": {}
}
mockup: dark hero band (title + abstract, from the hero section) above a
two-column learning path (a volume/chapter card at left, a resources tile at right) —
the actual page also renders a persistent dark nav bar and, for real content, chapter numbering
and thumbnail images not simulated here.
3. Data sheet
Source: Sources/DocCArchive/Vendored/RenderNode.spec.json, schema object
#/components/schemas/TutorialsPageRenderNode (lines 22–72), cross-checked
against the generated Components.Schemas.TutorialsPageRenderNode struct in
Sources/DocCArchive/generated/Types.swift (lines 2917–2984). This is the schema
DocCArchive uses for all three kind values it groups together
(overview/project/article) — the JSON Schema does not
split them into separate discriminated types the way it does for, say, block content.
| Field | Type | Required | Enum values / default | Note |
|---|---|---|---|---|
kind |
string | yes | "overview", "project", "article" |
Generated as a three-case KindPayload enum on
TutorialsPageRenderNode. overview is emitted only by
visitTutorialTableOfContents(_:); the sibling values cover tutorial-project and
tutorial-article pages, which share this same schema object but render through a different
Vue view chain (Topic.vue, not TutorialsOverview.vue). |
identifier |
ResolvedTopicReference |
yes | — | The page's own topic reference URL and interface language. |
hierarchy |
Hierarchy |
yes | — | Breadcrumb data; for an overview page this is normally just the page's own
reference with empty modules, since an overview page is the technology
root. |
title |
string | no | — | Generated as optional. Not populated by visitTutorialTableOfContents; the
displayed page title instead comes from metadata.title / the hero section's own
title. |
sections |
array of RenderSection |
yes | — | For an overview page: exactly one IntroRenderSection (kind hero),
then zero or more VolumeRenderSection (kind volume), then an optional
trailing ResourcesRenderSection (kind resources) — matching the
append order in visitTutorialTableOfContents. |
references |
map of string → RenderReference |
no | — | Generated as an optional additionalProperties-keyed struct. Holds resolved
topic/image/link references used by sections (e.g. each chapter's
tutorials entries, image identifiers). |
metadata |
TutorialsMetadata |
no | — | Only two fields declared in the vendored schema: category (string) and
categoryPathComponent (string). swift-docc's translator also sets
metadata.title, metadata.estimatedTime, and metadata.role
("overview", via DocumentationContentRenderer.role(for:) mapping
DocumentationNode.Kind.tutorialTableOfContents →
RenderMetadata.Role.overview) on the real RenderMetadata Swift type, none
of which are declared on the narrower vendored TutorialsMetadata schema object used
here — another gap between the wire schema DocCArchive vendors and swift-docc's fuller Swift
model, similar in kind to the one documented on the hero section-kind page.
estimatedTime is what Hero.vue actually reads for its metadata row. |
schemaVersion |
SchemaVersion |
yes | — | Major/minor/patch version of the render JSON format itself. |
4. HTML/CSS mapping in DocC-Render output
Rendered DOM shape, assembled from the components in section 1:
- Root:
div.tutorials-overview(fromcomponents/TutorialsOverview.vue), always dark-themed regardless of the site-wide color-scheme setting. Nav(classtheme-dark) — the persistent top bar, titled frommetadata.category, hidden whenisTargetIDEis true (i.e. when rendered inside Xcode's built-in documentation viewer rather than a browser).main#app-main.main > div.radial-gradient— wraps the hero band; the class name names the CSS background effect applied behind it.Herosubtree (see theherosection-kind reference page for its own internal DOM) — rendered onlyv-if="heroSection".div.learning-path > div.main-container > div.primary-content-container > div.content-sections-container(fromLearningPath.vue) — holds onesection.volumeper volume and one resources block per non-volume section, each wrapped in a shared.content-sectionclass for consistent card spacing; also renders a stickydiv.secondary-content-container > TutorialsNavigationside rail (hidden below thesmallbreakpoint and wheneverisTargetIDEis true).section.volume(fromVolume.vue) — an optionalVolumeNamefollowed by oneChapter(classtile) perchapters[]entry.
SCSS lives in each component's own scoped <style lang="scss"> block
(components/TutorialsOverview.vue and
components/TutorialsOverview/LearningPath.vue, both importing
docc-render/styles/_core.scss). The compiled, versioned output ships in the archive
as css/tutorials-overview.9c2b2457.css and
js/tutorials-overview.9144a669.js (observed in DocCArchive's own
ExampleDocs.doccarchive/SampleLibrary.doccarchive fixtures, confirming
this is a separate webpack chunk from the symbol/article topic bundle). Key CSS custom
properties consumed, defined per color scheme in
src/styles/core/colors/_light.scss (lines 187–195):
--color-tutorials-overview-background/--color-tutorials-overview-fill-secondary— the.radial-gradientbackground.--color-tutorials-overview-fill—.learning-path's background (falls back to a SCSSdark-color(fill)mixin call if unset).--color-tutorials-overview-content,--color-tutorials-overview-content-alt,--color-tutorials-overview-eyebrow,--color-tutorials-overview-icon,--color-tutorials-overview-link— text/icon/link colors used throughout the volume, chapter, and resources tile subcomponents.--color-tutorials-overview-navigation-link,-navigation-link-active,-navigation-link-hover— the sticky side-railTutorialsNavigationlink states.
components/TutorialsOverview.vue also forces the page <body>
background to the dark fill color unconditionally via a global (non-scoped) style block using the
relational :has() selector: body:has(.tutorials-overview) { --color-text-background:
#{dark-color(fill)}; } — a real, already-shipping use of :has() in this
codebase, notably not gated behind any interactivity.
DocCArchive transform status: MyHTMLTransformer and MyMarkdownTransformer
in Sources/DocCArchive/DocCArchive.swift are still stub placeholders (the HTML
transformer returns a hardcoded <!-- what? --> comment and the Markdown
transformer returns an empty string) — there is no kind-specific handling for
overview/TutorialsPageRenderNode today. Given the field gap documented in
section 3 (metadata.title/estimatedTime/role not present on
the vendored TutorialsMetadata schema), a future implementation would also need to
decode more than the generated type currently exposes to reproduce the hero metadata row
swift-docc-render actually shows for this page kind.
5. Modern CSS-only alternative
NOT APPLICABLE
Current behavior: nothing in the overview-page-specific chain identified in section 1
(views/TutorialsOverview.vue → components/TutorialsOverview.vue
→ LearningPath.vue → Volume.vue/Chapter.vue) holds
any client-side interactive UI state of its own. Every one of those components is a pure
props-in/template-out renderer: partitionedSections and
heroSection/otherSections in TutorialsOverview.vue, and the
analogous volumes/otherSections split in LearningPath.vue,
are plain Vue computed properties derived once from the incoming sections
prop — there is no data() boolean, no v-show/v-if
toggle driven by a click handler, and no :visible.sync modal anywhere in this
particular view chain (contrast with the hero section-kind page, where the nested
Hero.vue component does hold a callToActionModalVisible flag for its
"Watch intro video" modal — that state lives one level down, inside the hero section's own
component, not in anything specific to the overview page kind itself). The only
non-trivial runtime behavior directly attributable to this page kind is the router-level dispatch
described in section 1 (URL-shape → component selection) and the sticky positioning of the
side-rail navigation, both of which are either build/route-time decisions or plain CSS
(position: sticky in LearningPath.vue's SCSS, no JS involved). Because
this kind is a static content-arrangement container with no stateful interaction of its own to
replace, no native mechanism (<details>, radio+:checked,
:target, Popover API, <dialog>, :has(), container
queries, anchor positioning, view transitions) is being proposed as a replacement here; the verdict
is a plain "not applicable" for lack of any behavior to replace, not an unexplored opportunity.