Skip to content

feat: nargo doc#10314

Merged
TomAFrench merged 176 commits intomasterfrom
ab/nargo_doc_json
Nov 5, 2025
Merged

feat: nargo doc#10314
TomAFrench merged 176 commits intomasterfrom
ab/nargo_doc_json

Conversation

@asterite
Copy link
Collaborator

@asterite asterite commented Oct 28, 2025

Description

Problem

Will help with building aztec-nr docs, and any package docs in general.

Summary

This PR started as a new command to generate a JSON that would help build docs.

Then it produced a single Markdown file from that JSON output (or, well, from the Rust types representing that JSON).

Eventually, and this is the final form of this PR, it morphed into generating HTML files (with a stylesheet) to navigate the docs.

Here are example docs built from the aztec-nr repository: https://asterite.github.io/aztec-nr-docs/index.html

Features:

  • Docs layout is similar to rustdoc
  • Inter-linking between types
  • Documentation for dependencies is also generated, so you can navigate to any type via links (even stdlib types and primitive types)
  • Has a style similar to the lightweight theme of rustdoc
  • Has a navbar which is similar to the one in rustdoc (lets you quickly jump to sections in the current item, or in the parent item)
  • Has an "All items" section that lists all items (excluding depenedencies). This can also serve as a basic search functionality (search via the browser).

Note: the docs won't look very complete at this point but that's because aztec-nr lacks doc comments. There are some, but ideally every module and item is documented there, with examples, etc.

Additional Context

The large diff is because we now commit the generated stdlib docs.

Documentation

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: ae001a3 Previous: 65a8fb0 Ratio
test_report_zkpassport_noir_rsa_ 2 s 1 s 2

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@socket-security
Copy link

socket-security bot commented Oct 29, 2025

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 3384c75 Previous: dbe4d81 Ratio
sha512-100-bytes 0.087 s 0.055 s 1.58

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@asterite
Copy link
Collaborator Author

asterite commented Nov 4, 2025

I recently realized some types like Add or Mul didn't have links. It turns out they are re-exported, and the tool didn't analyze re-exports. This turned out to be even more important because for example compressed_string consists of a single re-export of a private item, so it was previously not shown. Or for example noir_aztec re-exports protocol_types, and without that information you wouldn't know you can access that via aztec-nr (so the docs wouldn't be that useful, really).

@TomAFrench
Copy link
Member

TomAFrench commented Nov 5, 2025

I took a quick look at getting the dead link checking up but it seems like a lot of tools are just set up for markdown and supposedly a lot of the ones which work on html files aren't maintained or complete.

I think in the meantime we can just remove the committed output and revisit in the future. We can keep things as a snapshot test to ensure that we don't completely wreck it as stdlib changes should be rare.

We can have a build of the stdlib docs pushed to gh_pages in a separate PR.

@TomAFrench TomAFrench enabled auto-merge November 5, 2025 14:38
@TomAFrench TomAFrench added this pull request to the merge queue Nov 5, 2025
Copy link
Contributor

@jfecher jfecher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool!

auto-merge was automatically disabled November 5, 2025 15:01

Pull Request is not mergeable

Merged via the queue into master with commit 0a91592 Nov 5, 2025
133 checks passed
@TomAFrench TomAFrench deleted the ab/nargo_doc_json branch November 5, 2025 15:07
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Nov 6, 2025
Automated pull of nightly from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore(frontend): Loop control flow unit tests (noir-lang/noir#10387)
chore: Release Noir(1.0.0-beta.15) (noir-lang/noir#10125)
feat(doc): crate name, version, and dark mode (noir-lang/noir#10378)
chore(elaborator): Add `LoopStatement` (noir-lang/noir#10377)
chore(elaborator): Ensure that `push_location` and `push_type` cannot be forgotten (noir-lang/noir#10374)
feat: nargo doc (noir-lang/noir#10314)
chore: Add remaining doc comments to interpreter (noir-lang/noir#10368)
chore: green light for bn254_blackbox_solver audit (noir-lang/noir#10371)
chore: elaborator types.rs nits (noir-lang/noir#10375)
fix: do not replace return for databus (noir-lang/noir#10355)
END_COMMIT_OVERRIDE

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Nov 6, 2025
Automated pull of nightly from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore(frontend): Loop control flow unit tests (noir-lang/noir#10387)
chore: Release Noir(1.0.0-beta.15) (noir-lang/noir#10125)
feat(doc): crate name, version, and dark mode (noir-lang/noir#10378)
chore(elaborator): Add `LoopStatement` (noir-lang/noir#10377)
chore(elaborator): Ensure that `push_location` and `push_type` cannot be forgotten (noir-lang/noir#10374)
feat: nargo doc (noir-lang/noir#10314)
chore: Add remaining doc comments to interpreter (noir-lang/noir#10368)
chore: green light for bn254_blackbox_solver audit (noir-lang/noir#10371)
chore: elaborator types.rs nits (noir-lang/noir#10375)
fix: do not replace return for databus (noir-lang/noir#10355)
END_COMMIT_OVERRIDE
github-merge-queue bot pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Nov 6, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore(frontend): Loop control flow unit tests
(noir-lang/noir#10387)
chore: Release Noir(1.0.0-beta.15)
(noir-lang/noir#10125)
feat(doc): crate name, version, and dark mode
(noir-lang/noir#10378)
chore(elaborator): Add `LoopStatement`
(noir-lang/noir#10377)
chore(elaborator): Ensure that `push_location` and `push_type` cannot be
forgotten (noir-lang/noir#10374)
feat: nargo doc (noir-lang/noir#10314)
chore: Add remaining doc comments to interpreter
(noir-lang/noir#10368)
chore: green light for bn254_blackbox_solver audit
(noir-lang/noir#10371)
chore: elaborator types.rs nits
(noir-lang/noir#10375)
fix: do not replace return for databus
(noir-lang/noir#10355)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants