Expand description
Rendering: solar AST -> vocs MDX.
StructsΒ§
- Comment
Data π - Ctx π
- Description π
EnumsΒ§
- Desc
Kind π
FunctionsΒ§
- code_
regions π - Byte ranges that MDX parses as code. An HTML entity would render literally inside these ranges, so neutralization skips them. If malformed MDX cannot be parsed, returning no ranges favors neutralizing possible ESM over preserving an invalid code example byte-for-byte.
- collect_
code_ πregions - Collect fenced and inline code positions from the MDX-aware syntax tree.
- collect_
comments π - Collect natspec from doc comments, applying inline link replacement.
- contract_
kind_ πstr - dedent π
- Strip common leading whitespace from all non-empty lines.
- escape_
table_ πcell - Escape a value so it is safe inside a markdown (GFM) table cell:
- find_
contract_ πid - Find the HIR
ContractIdfor a contract by name, requiring the contract to live in the source file currently being rendered (compared via absolute path) so contracts that share a file stem acrosssrc/andlib/cannot collide. - first_
notice π - function_
heading π - function_
signature_ πanchor - has_
local_ πnatspec - Returns the base contract name from
@inheritdoc Base, orNone. Whether the declaration carries any local NatSpec item other than@inheritdoc. Solidity only auto-inherits documentation for a member with none, so implicit inheritance is gated on this being false; a local@custom:*,@titleor@authorcounts as local documentation just like@notice/@dev/@param/@return. - inheritdoc_
base π - is_
known_ πcustom_ tag - Returns true if
taglooks like a generally-recognised natspec custom tag. - italicize_
dev π - Italicize a
@devblock by wrapping it in<i>...</i>HTML tags. Surrounding blank lines around the tags ensure MDX/CommonMark parses the inner content as block-level markdown (lists, code fences, multiple paragraphs all work). - logical_
lines π - Logical lines and their byte offsets in the original text. CRLF is one separator; lone CR and LF are separators too. The separator bytes are excluded from the returned slices and preserved in the source string.
- neutralize_
esm π - Neutralize any line MDX would parse as an ESM statement (
importorexportat column one): the keywordβs prefix becomes HTML entities, so the line renders the same but no longer begins with an ESM token. NatSpec text can be inherited from a dependency via@inheritdoc, so this must run wherever displayed prose is assembled. A keyword that falls inside a Markdown code span or fenced code block is left untouched (seecode_regions): the entity would render literally and corrupt the example, and MDX would not execute it there. - region_
contains π - Check a position against sorted, merged ranges while advancing monotonically.
- render_
constants π - render_
contract π - render_
enum π - render_
error π - render_
event π - render_
free_ πfunctions - render_
function_ πsection - render_
struct π - render_
udvt π - return_
description π - source
- Render a single Solidity source file as a list of
(relative_output_path, mdx_content)pairs. - strip_
one_ πws - write_
code_ πblock - write_
comment_ πblock - write_
deployments_ πtable - Write the Deployments table for a contract page.
- write_
enum_ πvariants_ table - write_
frontmatter π - write_
getter_ πtable - Render a getter signature table (
ParametersorReturns) from its inherited rows. - write_
git_ πsource - Write link if
git_urlis set. - write_
param_ πtable - write_
struct_ πproperties_ table - yaml_
escape_ πdouble_ quoted - Escape a string for use as a YAML double-quoted scalar.