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

Props in Docs? #7

Open
deathbreakfast opened this issue Feb 10, 2022 · 2 comments
Open

Props in Docs? #7

deathbreakfast opened this issue Feb 10, 2022 · 2 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed

Comments

@deathbreakfast
Copy link
Contributor

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?

@ctron
Copy link
Member

ctron commented Feb 10, 2022

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 😁

@ctron ctron added documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed labels Feb 10, 2022
@phill-85
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants