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

[docs] Move README.md into lib docs and use cargo-readme to generate the README #150

Open
virtualritz opened this issue Feb 7, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@virtualritz
Copy link

I would do this and open a PR, if you're ok with that.

I think it would also be great to split the info in the guide up for the docs and put a copy of the resp. part under each function/struct it pertains to.

The guide is great for a start but I find myself frequently not having bits and bobs of it in the docs and then having to jump back and forth.

@virtualritz virtualritz added the enhancement New feature or request label Feb 7, 2022
@johannesvollmer
Copy link
Owner

Ah yes nice.

The guide is meant for overview, so it would be nice to keep information about the relationship between types. If something is only important for a single type, it should definitely be moved to the type documentation :)

Can you give an example how exactly you would split it up?

@virtualritz
Copy link
Author

Can you give an example how exactly you would split it up?

I would copy the guide's Reading an Image->Layer section under a Layer struct docs Reading section and the Writing an Image->Layer section under a Layer struct docs Writing section.

And the same for all the other structs the guide has details on.

I also thought about opening a ticket with cargo-readme and ask for a feature that allows deriving a GUIDE.md or even a MD book from extracting all the information found in inline docs.

I think this is very feasible. If you write good docs with examples they are almost like a guide, just finicky to navigate/understand for a first time user.
E.g. I though about writing a guide for my nsi crate and mostly this would just be copypasta of inline docs I already wrote.

@virtualritz
Copy link
Author

That doesn't mean you wouldn't keep the guide as-is ofc. The guide is very valuable for people new to the crate.

@johannesvollmer
Copy link
Owner

I also thought about opening a ticket with cargo-readme and ask for a feature that allows deriving a GUIDE.md or even a MD book from extracting all the information found in inline docs.

This sounds interesting. The duplication of information was my main pain point in the previous discussion. Deriving the Guide or a Book from the docs would be wonderful. How does it work? Will it simply append the docs from multiple types, or is it more complex?

@virtualritz
Copy link
Author

Haven't thought about it much. Afaik cargo-readme allows for templates. I was thinking that you have a section in the docs for each type/method/whatever and you may want to include that section in a guide at a specific place.

Possibly in the start of a section about that type/method/whatever. This also forces you to write the docs in a way that the text is suitable for a guide which is good practice, IMHO.

@johannesvollmer
Copy link
Owner

johannesvollmer commented Feb 9, 2022

Sounds good. It will be worth the effort. Would you have a look and try to assemble a prototype?

One wish: Please try to keep the root directory as small as possible, try to put everything into a subfolder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants