Skip to main content

Crate forge_doc

Crate forge_doc 

Source
Expand description

§forge-doc

Solidity documentation generator powered by solar.

§Overview

forge-doc walks the solar HIR (High-level Intermediate Representation) and emits vocs-flavoured MDX pages suitable for publishing as a documentation site.

§Key components

  • DocBuilder: entry point, configures source roots, output directory, and optional Git/deployment metadata, then calls build() to generate the docs.
  • render: AST → MDX conversion with HIR lookups. Handles contracts, functions, structs, enums, errors, events, and UDVTs, including @inheritdoc resolution and inline {Link} rewriting. Depends on HIR for inheritance and cross-reference resolution.
  • hir_ext: HIR-aware helpers including name-to-page mapping, inheritance links, inheritdoc resolution, and inline link replacement.
  • utils: small utility functions, git_source_url and read_deployments.
  • vocs: vocs site scaffolding, generates vocs.config.ts, vocs.sidebar.ts (always regenerated, imported by vocs.config.ts), package.json, .gitignore, and src/pages/index.mdx.

Modules§

builder 🔒
hir_ext 🔒
HIR-aware enrichments.
render 🔒
Rendering: solar AST -> vocs MDX.
utils 🔒
GitSource + Deployments helpers.
vocs 🔒
Vocs site file generation.

Structs§

BuildStats
Summary stats produced by DocBuilder::build, surfaced to the user as progress feedback by forge doc.
DocBuilder
Build Solidity documentation for a project from natspec comments using [solar].