-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
implement forc doc
#161
Comments
Is this unblocked by #267? |
@emilyaherbert it definitely helps a lot, thanks! |
Just updating this with some recent developments: Sway now supports attributes as of #1488. The easiest approach to implementing this might be to follow in Rust's footsteps by supporting doc comments on ImplementationMight look something like:
Step 3 and its parts are a little hand-wavey for now and gloss over big steps like linking That said, it's probably best to start by getting some basic, raw HTML+markdown docs with minimal (no) linking working first, then we can write up dedicated issues for fancier features like styling, linking to other item declarations (perhaps using |
We will also need to consider how to handle our current multiline docs, i.e:
though rust probably already has a solution for this too. |
My intuition is that multiline doc comments are handled just the same, but the attribute they turn into is broken along multiple lines, something like: #[doc = r###"
Withdraw coins back to L1 and burn the corresponding amount of coins on L2.
# Arguments
* `to` - the destination of the transfer (an Address or a ContractId)
# Reverts
* When no coins were sent with call
"###] |
Do we actually want to support this syntax? Right now an attribute is an |
For future readers/implementers: this RFC covers the parsing of doc comments into an attribute representation, a good first step in addressing this. @sezna I think I remember you mentioning you'd started on this^ ? If so, are you up for posting a draft? Now that |
I have not started on any actual implementation of docstrings. That task is still open for the taking. I just went ahead and cleared assignees: #149 |
it should generate docs for Sway constructs: Structs, Enums, Traits, Functions etc
it should work similar as
cargo doc
The text was updated successfully, but these errors were encountered: