Skip to main content

Module render

Module render 

Source
Expand description

Rendering: solar AST -> vocs MDX.

StructsΒ§

CommentData πŸ”’
Ctx πŸ”’
Description πŸ”’

EnumsΒ§

DescKind πŸ”’

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 ContractId for 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 across src/ and lib/ cannot collide.
first_notice πŸ”’
function_heading πŸ”’
function_signature_anchor πŸ”’
has_local_natspec πŸ”’
Returns the base contract name from @inheritdoc Base, or None. 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:*, @title or @author counts as local documentation just like @notice/@dev/@param/@return.
inheritdoc_base πŸ”’
is_known_custom_tag πŸ”’
Returns true if tag looks like a generally-recognised natspec custom tag.
italicize_dev πŸ”’
Italicize a @dev block 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 (import or export at 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 (see code_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 (Parameters or Returns) from its inherited rows.
write_git_source πŸ”’
Write link if git_url is set.
write_param_table πŸ”’
write_struct_properties_table πŸ”’
yaml_escape_double_quoted πŸ”’
Escape a string for use as a YAML double-quoted scalar.