-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(forge): doc #2701
feat(forge): doc #2701
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on making doc
a crate, let's try to move as much of the logic there,
ideally, there should be some kind of Builder, or function that accepts a config and will handle it from there.
doc/src/format.rs
Outdated
impl<'a> DocFormat for DocOutput<'a> { | ||
fn doc(&self) -> String { | ||
match self { | ||
Self::H1(val) => format!("# {val}"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to add pandoc attribute headers here too?
see pandoc docs about attr headers
Also, idk if you may find this useful reference https://github.com/sambacha/go-natspec , would like to see forge doc as a separate binary if possible (if its a separate crate this should be the case correct?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only did a high level review, just because this is quite huge, but it's very readable and you can understand how this is supposed to work just by reading this.
smol nits, otherwise lgtm
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Running on the Seaport 1.2 branch results in a rather unhelpful error:
|
Only Can we add reference links for each natspec section back to the relevant source lineos? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely incredible. Would prefer if we used Axum instead of Warp. Love the Preprocessor keeping things clean.
Motivation
Implementation of
forge doc
described in #1675Solution
The
forge doc
command parses the source contracts and generates markdown files under<root>/docs
. These files can be served by runningforge doc --serve
.See README for more details on the architecture of the
doc
module