Skip to main content

Module utils

Module utils 

Source
Expand description

GitSource + Deployments helpers.

Pure functions ported from the legacy forge-doc preprocessors:

  • git_source_url: <repo>/blob/<commit>/<rel> for a source file.
  • read_deployments: load <dir>/<network>/<contract>.json artifacts.

Structsยง

Deployment
A contract deployment entry, deserialised from <dir>/<network>/<contract>.json.

Functionsยง

contract_kind_str ๐Ÿ”’
The filename prefix used for a contract page.
git_raw_url
Return a {repo}/raw/{commit}/... URL suitable for embedding binary assets (images, fonts, etc.) directly rather than the GitHub blob viewer page.
git_source_url
Build the {repo}/blob/{commit}/{rel} URL for a source file.
is_safe_output_path ๐Ÿ”’
Whether joining a generated path can stay within the documentation directory.
page_path ๐Ÿ”’
Construct an item page beside its source in the documentation tree.
read_deployments
Read all deployments for a Solidity contract file.
relative_source_path ๐Ÿ”’
Map a source to its documentation location, retaining the legacy external-library layout.