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

Include primitive types in forc-doc generated docs #5968

Closed
sdankel opened this issue May 6, 2024 · 1 comment · Fixed by #6032
Closed

Include primitive types in forc-doc generated docs #5968

sdankel opened this issue May 6, 2024 · 1 comment · Fixed by #6032
Labels
enhancement New feature or request forc-doc Everything related to the `forc doc` command plugin.

Comments

@sdankel
Copy link
Member

sdankel commented May 6, 2024

forc-doc generates a static documentation website from sway code (specifically, from the sway compiler output).

Sway primitives are, however, written in Rust. We need a way for forc-doc to generate docs for the primitive types and include them as a submodule in the sway-lib-std docs. Some possible solutions:

rust-doc

Maybe we can use rust doc just for the std library for those files and splice them into the forc doc result somehow. rust-doc wouldn’t show usages or trait implementations though, since those are written in sway.

Generate primitive definitions in sway

Maybe there’s a way to generate sway code from the primitive type definitions in rust. If we could generate valid sway code and include it in the lib-std package, forc-doc would generate docs for it.

Custom plugin for generating primitive docs

We could write a custom plugin like forc-doc-primitives that generates docs for the primitives.

Open to other ideas/suggestions!

@sdankel sdankel added enhancement New feature or request forc-doc Everything related to the `forc doc` command plugin. labels May 6, 2024
@sdankel
Copy link
Member Author

sdankel commented May 8, 2024

This will be mostly solved by generating docs for the primitive type impls: #5957

Closing this as a duplicate.

@sdankel sdankel closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2024
@sdankel sdankel reopened this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forc-doc Everything related to the `forc doc` command plugin.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant