Extracts all public unsafe APIs from the Asterinas source code and generates a static HTML report with a searchable/filterable table.
- Clones the Asterinas repository.
- Recursively scans all Rust files (
.rs) in the source tree. - Analyzes public unsafe items in four categories:
function:pub unsafe fnmethod:pub unsafe fninsideimpltrait:pub unsafe traittrait_method:unsafe fndefined inside apub unsafe trait(API name format isTraitName::MethodName)
- Extracts full documentation comments and the
# Safetysection. - Generates an HTML page with a table, type filtering, fuzzy search, and JSON export.
python3 unsafe_doc_generator.py \
--local-dir "/path/to/asterinas" \
--remote-repo-url "https://github.com/asterinas/asterinas" \
--remote-ref "main" \
--output-dir docs--local-dir: local scan directory (required).--remote-repo-url+--remote-ref: used to generate clickable API links.--remote-path-prefix: optional manual remote path prefix. If omitted, auto-derived from git root.--output-dir: output directory (default:site).
| Field | Description |
|---|---|
| Module Path | Derived from the source file path |
| API Name | Function/trait/method name (linked to source) |
| Type | function, method, trait, or trait_method |
| Full Doc | Complete doc comment |
| Safety Doc | # Safety section only |
| Confirmed | Button with state persisted in browser localStorage |
The report is served from the docs/ folder on the main branch:
Regenerated automatically by the CI workflow on every push to main and
daily at 2 AM UTC.
- Go to Settings → Pages.
- Under Source, select Deploy from a branch.
- Choose branch
mainand folder/docs, then click Save.