Expand description
Rendering: solar AST -> vocs MDX.
Re-exportsยง
use crate::hir_ext;๐use crate::hir_ext::NameToPage;๐use crate::hir_ext::clean_block_doc_content;๐use crate::markdown::code_regions;๐use crate::markdown::logical_lines;๐use crate::markdown::neutralize_esm;๐use crate::utils::Deployment;๐use crate::utils::contract_kind_str;๐use crate::utils::page_path;๐use foundry_common::sh_warn;๐use markdown::ParseOptions;๐use markdown::mdast::Node;๐use markdown::to_mdast;๐use solar::ast::CommentKind;๐use solar::ast::ContractKind;๐use solar::ast::DocComments;๐use solar::ast::FunctionKind;๐use solar::ast::Item;๐use solar::ast::ItemContract;๐use solar::ast::ItemFunction;๐use solar::ast::ItemKind;๐use solar::ast::NatSpecKind;๐use solar::ast::ParameterList;๐use solar::ast::SourceUnit;๐use solar::ast::Span;๐use solar::ast::VariableDefinition;๐use solar::interface::Ident;๐use solar::interface::source_map::FileName;๐use solar::interface::source_map::SourceFile;๐use solar::sema::Gcx;๐use solar::sema::hir;๐use std::fmt::Write as _;๐use std::ops::Range;๐use std::path::Path;๐use std::path::PathBuf;๐use std::sync::Arc;๐
Structsยง
- Comment
Data ๐ - Ctx ๐
- Description ๐
- Links ๐
- The link environment for one page, including its local member anchors.
Enumsยง
- Desc
Kind ๐
Functionsยง
- collect_
comments ๐ - Collect natspec from doc comments, applying inline link replacement.
- 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:
- fence_
marker ๐ - fenced_
description_ ๐regions - Complete fenced code blocks that are direct children of the description document. Restricting preservation to root-level blocks keeps list, quote, table, and unclosed-fence behavior on the conservative escaping path.
- 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_
inheritdoc ๐ - 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. - is_
complete_ ๐fence - 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). - neutralize_
fence_ ๐markers - Keep rejected or incomplete fence markers from changing the Markdown context of subsequent descriptions. Entities render as the original marker characters without acting as syntax.
- render_
constants ๐ - render_
contract ๐ - render_
free_ ๐functions - render_
function_ ๐section - replace_
description_ ๐links - Replace inline links in a standalone notice or dev description while preserving complete,
top-level fenced code blocks. Other NatSpec fields use
replace_inline_linksdirectly because their rendering context (notably table cells) cannot contain block-level Markdown. - return_
description ๐ - sanitize_
description_ ๐prose - 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_
item_ ๐body - Render the common body of a struct, enum, event, error, or value type.
- write_
page_ ๐header - write_
param_ ๐table - write_
signature_ ๐table_ header - Common layout for parameters, returns, and struct properties.
- write_
struct_ ๐properties_ table - yaml_
escape_ ๐double_ quoted - Escape a string for use as a YAML double-quoted scalar.