section

parameters

Wire value: "parameters"

Appears on: Documentation Topic

1. How swift-docc-render consumes this

The dispatch happens in PrimaryContent.vue, which renders a symbol's array of primary-content sections. It keys a lookup table on section.kind via a SectionKind constant map (defined in constants/PrimaryContentSection.js). For SectionKind.parameters it selects the Parameters component and passes through the section's parameters array as a prop:

componentFor(section) {
  return {
    ...
    [SectionKind.parameters]: Parameters,
    ...
  }[section.kind];
},
propsFor(section) {
  const { ..., parameters, ... } = section;
  return {
    ...
    [SectionKind.parameters]: { parameters },
    ...
  }[kind];
},

The actual rendering happens in Parameters.vue. Its template root is a <section class="parameters"> containing a heading (via the shared LinkableHeading component, anchored to "parameters" per ContentSectionAnchors.js) followed by a definition list (<dl>) built by iterating the parameters array — one <dt class="param-name"> holding the parameter's name in a <code> element, paired with one <dd class="param-content"> that delegates the parameter's content (an array of standard RenderBlockContent blocks) to the generic <ContentNode> component for recursive block rendering:

<section class="parameters">
  <LinkableHeading :anchor="contentSectionData.anchor">
    {{ $t(contentSectionData.title) }}
  </LinkableHeading>
  <dl>
    <template v-for="param in parameters">
      <dt class="param-name" :key="`${param.name}:name`">
        <code>{{ param.name }}</code>
      </dt>
      <dd class="param-content" :key="`${param.name}:content`">
        <ContentNode :content="param.content" />
      </dd>
    </template>
  </dl>
</section>

This is a plain, stateless <dl> — no click handlers, no toggling, no reactive local state. It is worth explicitly distinguishing this from a sibling component with a similar name: ParametersTable.vue is a grid-based table used for the REST-flavored kinds (restParameters, restHeaders, restCookies) via RestParameters.vue, not for the plain-symbol parameters kind documented on this page.

See also: Localization fallback — how $t()/locale-key lookup works across every kind that uses it.

2. Example JSON and rendered mockup

No fixture containing a rendered RenderNode with "kind": "parameters" was found in either DocCArchive's test fixtures (Tests/DocCArchiveTests/Fixtures/ExampleDocs.doccarchive and SampleLibrary.doccarchive — their documented symbols don't happen to include a rendered Parameters section) or in swift-docc's Tests/SwiftDocCTests/ suite (matches there were either symbol-graph input files, i.e. the pre-render source data DocC consumes, or the unrelated restParameters/REST-flavored kind). The example below is therefore hand-written.

{
  "kind": "parameters",
  "title": "Parameters",
  "parameters": [
    {
      "name": "path",
      "content": [
        {
          "type": "paragraph",
          "inlineContent": [
            {
              "type": "text",
              "text": "The file system location to read from."
            }
          ]
        }
      ]
    },
    {
      "name": "encoding",
      "content": [
        {
          "type": "paragraph",
          "inlineContent": [
            {
              "type": "text",
              "text": "The text encoding to assume when decoding the file's contents."
            }
          ]
        }
      ]
    }
  ]
}
Parameters
path
The file system location to read from.
encoding
The text encoding to assume when decoding the file's contents.

3. Data sheet

Per Sources/DocCArchive/Vendored/RenderNode.spec.json, schema object ParametersRenderSection (lines 2677–2698), which cross-checks against the generated Components.Schemas.ParametersRenderSection struct in Sources/DocCArchive/generated/Types.swift (lines 6218–6250), plus the nested DocumentationParameter schema object (spec lines 2699–2716; generated type lines 6251–6268).

FieldTypeRequired?Enum values / defaultNote
kindstringyes["parameters"] (single-value enum)Discriminator value; matches RenderSectionKind.parameters in swift-docc's Swift model.
titlestringno—Not set by ParametersSectionTranslator in current swift-docc; the Vue component supplies its own localized heading text (sections.parameters → "Parameters") rather than reading this field.
parametersarray of DocumentationParameteryes—One entry per named parameter, in signature order.
DocumentationParameter.namestringyes—The parameter's local (non-external/non-argument-label) name, per swift-docc's ParameterRenderSection.name.
DocumentationParameter.contentarray of RenderBlockContentyes—Free-form block content (paragraphs, lists, code blocks, etc.) describing the parameter; can be an empty array if the author wrote no description.

Note on naming: the JSON Schema / generated Swift type name is ParametersRenderSection (as given for this page's doccArchiveType), while swift-docc's own Swift source (Sources/SwiftDocC/Model/Rendering/Symbol/ParameterRenderSection.swift, lines 12–21) defines an identically-named public struct ParametersRenderSection: RenderSection, Equatable with a parameters: [ParameterRenderSection] field — i.e. swift-docc's per-item type is called ParameterRenderSection (singular) where the vendored JSON Schema/generated Swift calls the equivalent per-item type DocumentationParameter. These are the same wire shape under two different Swift type names in the two codebases; the JSON on the wire is identical either way.

4. HTML/CSS mapping in DocC-Render output

5. Modern CSS-only alternative

Not applicable

Current behavior: Parameters.vue holds no component-local reactive state and has no click/toggle/expand-collapse handlers of any kind — it is a straight, one-way v-for template render of a static array into a <dl>, with the only interactive element being the LinkableHeading's in-page anchor link (a plain <router-link> href, not a JS-driven show/hide toggle). There is no analogue here to, say, a tab navigator's currentTitle plus v-show pattern.

Because there is no interactive state to reproduce (no expand/collapse, no active/inactive selection, no show/hide), 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 specific kind. The one piece of "state" on the page — which section is scrolled into view via its #parameters anchor — is already handled by plain browser URL-fragment navigation (id="parameters" + a normal link), which is itself already a native mechanism, not something DocC-render is reimplementing in JS.