Skip to content

Include class variables in markdown output and index.csv #48

@skatkov

Description

@skatkov

Problem

Class variables (for example @@rubber_ducks) are currently missing from generated markdown and index.csv in rdoc-markdown, while previous YARD-based output indexed them.

Desired outcome:

  • class variables are discoverable in generated docs,
  • class variables are represented in index.csv.

Constraints and Investigation Notes

  • RDoc parser does not expose class variables in the same way as constants.
  • In Ruby parser logic, constant capture is gated by /^\\w+$/, which excludes @@... names.
  • This likely requires either:
    • using hidden/available parser metadata if present, or
    • a supplemental extraction pass (Prism/Ripper-based) mapped to class/module context.

Proposed Tasks

  • Add failing tests first (fixture expects class variable entry + anchor).
  • Investigate available data in RDoc store for class variables across supported versions.
  • Implement extraction strategy if class variables are not available from store.
  • Emit class-variable section/anchors in markdown docs.
  • Emit corresponding index.csv rows (proposed type=Constant for compatibility with existing consumers).
  • Keep anchor format deterministic and encoded consistently.
  • Add link/anchor validation coverage for new class-variable rows.

Example Expected Entry

Duck.@@rubber_ducks,Constant,Duck.md#classvariable--40-40rubber_ducks

Acceptance Criteria

  • Class variables appear in markdown with valid anchors.
  • Class variables appear in index.csv.
  • Index links resolve to real anchors.
  • Existing tests continue to pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions