FuelLabs / sway

🌴 Empowering everyone to build reliable and efficient smart contracts.

Home Page:https://fuellabs.github.io/sway

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include primitive types in forc-doc generated docs

sdankel opened this issue · comments

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!

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

Closing this as a duplicate.