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

Autoformat documentation examples and update README #9

Merged
merged 1 commit into from
May 7, 2021

Conversation

MarijnS95
Copy link
Contributor

@MarijnS95 MarijnS95 commented May 4, 2021

As mentioned in 1 the documentation example could use some autoformatting, and recent API changes have to be propagated into the README too.


I'm curious if we should just paste the full working example in README, that's much clearer IMO, or refernce. @katyo given your CI efforts you might like https://docs.rs/doc-comment/, a crate that (build)tests the documentation in arbitrary markdown files like README.md from build.rs. If we put a fully working example here we can also make sure that it stays in a compiling state :)

As mentioned in [1] the documentation example could use some
autoformatting, and recent API changes have to be propagated into the
README too.

[1]: Smithay#4 (comment)
@Drakulix Drakulix merged commit bc3e2d1 into Smithay:develop May 7, 2021
@Drakulix
Copy link
Member

Drakulix commented May 7, 2021

Thanks!

@MarijnS95 MarijnS95 deleted the update-examples branch May 7, 2021 12:46
@katyo
Copy link
Contributor

katyo commented May 9, 2021

@MarijnS95, I'm on a way to adopt another approach in my crates. I simply used cargo-readme to generate READMEs from doc comment. In addition I added CI rules which helps update README when docs changed.
See the katyo/aubio-rs#18 for example.

@Drakulix, I don't sure how such approach applicable here but looks like much simpler.

@MarijnS95
Copy link
Contributor Author

@katyo That seems like a pretty cool idea! Most READMEs are partial duplicates of the documentation header and apparently it even supports templates to generate the readme. And it strips # comments from rustdoc codeblocks too!

I'll have to try this out some time, maybe this GBM crate with a relatively slim readme is a good place to start :)

@MarijnS95
Copy link
Contributor Author

MarijnS95 commented May 10, 2021

Check with our documentation, unfortunately it doesn't strip empty comment lines with //! # - but when replaced //! (unsurprisingly so) empty lines show up :/

EDIT: That'll be fixed by webern/cargo-readme#67.

MarijnS95 added a commit to MarijnS95/gbm.rs that referenced this pull request May 10, 2021
MarijnS95 added a commit to MarijnS95/gbm.rs that referenced this pull request May 10, 2021
MarijnS95 added a commit to MarijnS95/gbm.rs that referenced this pull request May 10, 2021
@Drakulix
Copy link
Member

@Drakulix, I don't sure how such approach applicable here but looks like much simpler.

I really like that idea. 👍
Would be cool if someone could follow up with a PR.

@MarijnS95
Copy link
Contributor Author

@Drakulix, I don't sure how such approach applicable here but looks like much simpler.

I really like that idea. 👍
Would be cool if someone could follow up with a PR.

@Drakulix you have one in #11, but it's blocking on a fix on their side. Review and suggestions welcome :)

MarijnS95 added a commit to MarijnS95/gbm.rs that referenced this pull request Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants