Skip to content

Separate parent context and parent page #1088

@alandefreitas

Description

@alandefreitas

Problem

Many features need both the AST parent (context) and the documentation parent (page). Today, we keep only one reference, so templates and visitors rebuild whichever relationship they need. One example is overload sets, where the parent page is the overload set and the parent ast context is the namespace/record of each function.

Proposed solution

  • Add two fields to symbol metadata for the AST parent and navigation parent.
  • Populate both during extraction or post-processing. Example: a function’s context is its namespace or record; its page is the overload set.
  • Update Handlebars helpers and traversal utilities to rely on the new fields instead of ad-hoc lookups.
  • Document the convention so new code uses the correct parent.

Requirements

  • Metadata exposes both relationships for every symbol.
  • Templates no longer duplicate parent-resolution logic.
  • Traversal helpers accept a parameter to choose a context or a page, and these are used in generators.
  • Tests cover cases where the two parents diverge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions