-
-
Notifications
You must be signed in to change notification settings - Fork 1
Switch to #![doc = include_str!("../README.md")]
#23
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
base: master
Are you sure you want to change the base?
Conversation
|
But why? API docs don't need licence and contributing info or the shield badges. I understand for getrandom (where the docs largely concern platform support and configuration), but I don't think it's a useful approach in most other crates. |
|
I think it's better for README and crate-level docs to use the same text. I also plan to add small exmples to README and it's better to test those as part of our CI. Highlighting license of the crate as part of easily visible docs is also not a bad thing in my opinion. |
That can be done under a test module.
Brevity is a good thing in my opinion. |
By copy-pasting code? It's a bad approach to keeping user-facing examples up-to-date. Granted, it's not a big concern for
I can remove the contributing section, if you want. It would make the license section just few lines long. |
No; by using exactly the same mechanism but hiding the result by attaching it to a
It belongs in the README but not API docs. You haven't convinced me that the overlap between the two is significantly greater than zero content 😄 |
How does it apply to examples in README?
We did not have the contributing section before now at all, so removing it from this PR should not be an issue. And is my understanding correct that you don't have objections to having the licensing section in crate-level docs?
I don't see a reason why the crate introductory text should differ between crate-level docs and README. So it's certainly not zero. Overall, I believe that |
You could use
Not too important, but it's still extra content that doesn't need to be there. In general I think it bad to require users scroll past lots of unnecessary text when using API docs. But some tricks can be used to hide certain content; see here: https://linebender.org/blog/doc-include/ |
|
Just as an input for someone using the Less duplication is a plus, but mostly it standardises that the initial part of the docs is a quick start, with a pointer to a tutorial section. Scrolling is "cheaper" than clicking through a link, so I worry less about a bit too much content. But importantly, it ensures that no matter what, that initial landing point is the same and I can ensure the user is directed to where they need to. This is just an example of why I went with |
|
Thanks for the insight @Bluefinger. Have you tried using cargo-rdme? Example use case. This may be a good approach. |
Looks handy, though I usually prefer not to need specific tools for this, but it being usable in CI alleviates some of those concerns. |
Additionally, updates README and simplifies it a bit.