patternfly-yew-quickstart icon indicating copy to clipboard operation
patternfly-yew-quickstart copied to clipboard

Props in Docs?

Open deathbreakfast opened this issue 4 years ago • 2 comments

It might be helpful to read and add the props to the documentation. Would be nice to pull these dynamically. Not sure what the best solution would be for this. Can probably add a macro to the original components and expose a method through a Cargo feature?

deathbreakfast avatar Feb 10 '22 04:02 deathbreakfast

I agree. So far, my strategy has been to keep this aligned with the ReactJS and/or HTML names/structs of PatternFly. So that reading the docs of PatternFly, should make it easy to translate this into the Rust world.

However, sometimes things work differently in Rust, or Yew, or I just did it differently. So some proper, generated documentation might be pretty useful.

I mean, there are the source docs to: https://docs.rs/patternfly-yew/0.1.2/patternfly_yew/struct.Toast.html

However, most of the components don't have much explanation: https://docs.rs/patternfly-yew/0.1.2/patternfly_yew/struct.TextInputProps.html

I guess the structure is mostly the same. There are yew components, which has a property type. Which should have source code level documentation. Maybe that way, there could be some trait that can be implemented using a macro, which describes the component and its properties, sourcing the information from the source code level docs. And with that, it should be easy to create some interactive docs.

Contributions welcome :grin:

ctron avatar Feb 10 '22 08:02 ctron

There is an (unstable) feature in rust doc for outputting the docs in a json format

We might be able to use that.

I had a play but couldn't get it to work. rustdoc src/lib.rs fails with errors for me.

phill-85 avatar Jun 20 '23 09:06 phill-85