Skip to content
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 #1675

Closed
2 of 4 tasks
rkrasiuk opened this issue May 20, 2022 · 7 comments · Fixed by #2701
Closed
2 of 4 tasks

feat: forge doc #1675

rkrasiuk opened this issue May 20, 2022 · 7 comments · Fixed by #2701
Assignees
Labels
C-forge Command: forge Cmd-forge-doc Command: forge doc T-feature Type: feature

Comments

@rkrasiuk
Copy link
Collaborator

rkrasiuk commented May 20, 2022

Component

Forge

Describe the feature you would like

This feature request is a tracker for forge doc subcommand that, given the solidity source files, generates an mdbook-like documentation with an option to serve it.

Tasks:

  • create a doc crate with sample doc output struct
  • reuse fmt's Visitor for parsing source files
  • create default templates
  • render the doc output into templates

References:

Additional context

No response

@rkrasiuk rkrasiuk added the T-feature Type: feature label May 20, 2022
@onbjerg onbjerg added this to Foundry May 20, 2022
@onbjerg onbjerg moved this to Todo in Foundry May 20, 2022
@transmissions11
Copy link
Contributor

another (better imo) reference: https://github.com/primitivefinance/primitive-dodoc

@rkrasiuk
Copy link
Collaborator Author

nice find! including into the list

@onbjerg onbjerg added the C-forge Command: forge label May 23, 2022
@0xYYY
Copy link
Contributor

0xYYY commented Jun 14, 2022

taking a look at this, currently working on a proof of concept, will send PR later to start discussion on details

@onbjerg onbjerg moved this from Todo to In Progress in Foundry Jun 14, 2022
@odyslam
Copy link
Contributor

odyslam commented Jun 29, 2022

https://github.com/ZeframLou/foundry-docgen

@onbjerg
Copy link
Member

onbjerg commented Jul 1, 2022

See my comment here on ideas I had for forge doc: #1410 (comment)

Also see the original issue: #1410 (comment)

I've closed that issue to roll it up into this one

@rkrasiuk rkrasiuk self-assigned this Aug 8, 2022
@onbjerg onbjerg linked a pull request Aug 11, 2022 that will close this issue
@rkrasiuk rkrasiuk added the Cmd-forge-doc Command: forge doc label Aug 11, 2022
@rkrasiuk
Copy link
Collaborator Author

rkrasiuk commented Oct 27, 2022

Outstanding items for #2701:

  • Render top level funcs/structs/events. Currently, forge doc renders only contracts and all it's children items as the output. Provide a way to handle other top level items.
  • Test coverage for DocParser & DocBuilder
  • Merge DocConfig with foundry config
  • Add contributor docs to the doc crate (that's on me)
  • Investigate unreachable items
    item => {
    println!("UNREACHABLE {:?}", item); // TODO:
    unreachable!()
    }
  • Clean up code

@samlaf
Copy link
Contributor

samlaf commented Dec 23, 2022

+1. Would really like to use this feature.
In the meantime, I'm using https://github.com/OpenZeppelin/solidity-docgen combined with https://book.getfoundry.sh/config/hardhat, but it would be nice not to have to pollute our project with hardhat stuff only for generating documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-doc Command: forge doc T-feature Type: feature
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants