Expand description
HIR-aware enrichments.
Pure functions over solarβs HIR:
build_name_to_page: maps contract names to their MDX page paths.inheritance_links:**Inherits:**line for a contract page.resolve_inheritdoc: pulls natspec from a base contract member.replace_inline_links: rewrites{Ident}to markdown links.
StructsΒ§
- Inherited
Doc - Collected natspec tags from an inherited base member.
- Name
ToPage - Maps Solidity identifiers and HIR ids to their output MDX page paths
relative to
pages/.
FunctionsΒ§
- build_
name_ to_ page - Build the
NameToPageindex from HIR by re-deriving each itemβs output path. - clean_
block_ πdoc_ content - Strip the
*block-comment line decoration from each line of a/** */NatSpec itemβs content. Solar preserves raw source bytes, so continuation lines look like* textand blank separator lines look like*. This normalises them to plain text / empty lines. - collect_
inherited_ πdoc - escape_
link_ πlabel - Escape a string for use as a markdown link label.
- extract_
inherited_ πdoc - extract_
inherited_ πdoc_ var - function_
param_ πtypes - Extract the parameter type strings (in source order) for a function.
- function_
signature_ πanchor - inheritance_
links - Returns the
**Inherits:**markdown string for a contract, orNoneif it has no bases. - normalize_
sol_ πtype - Canonicalize Solidity type aliases so that e.g.
uint[]anduint256[]compare equal during overload matching. - page_
link π - Produce a vocs-style link from
pagerelative tocurrent_page. - parameter_
type_ strings - Compute the parameter type strings of a [
ParameterList] from the source map. - parse_
inline_ πlink - Parse
{[xref-]Ident[-part]}[label]starting at offset 0 ins. - replace_
inline_ links - Replace
{Ident}and{xref-Ident}with markdown links usingname_to_page. - resolve_
inheritdoc - Resolve
@inheritdoc BaseContractfor a function namedfn_nameinsidecontract_id(the current contract). Walks the linearized bases to find a matching function and returns its natspec if found. - resolve_
inheritdoc_ var - Resolve
@inheritdoc BaseContractfor a state variable namedvar_nameinsidecontract_id. Walks the linearised bases to find a matching public variable and returns its natspec if found. - resolve_
page π - Pick the best candidate page for a given cross-reference lookup.
- slug_
anchor_ πsegment - source_
paths π - xref_
part_ πanchor