containerd / rust-extensions

Rust crates to extend containerd
https://containerd.io
Apache License 2.0
184 stars 74 forks source link

Simplify doc management and update READMEs #208

Closed mxpv closed 1 year ago

mxpv commented 1 year ago

Currently we manage root documentation for each crate in 2 places: crate's README.md on Github and module's root documentation (comments that start with //!) that gets uploaded to docs.rs. Typically this is the same text that needs to be present in 2 places.

This PR aims to simplify this flow and uses README.md in both places, so there is no need to sync docs. When building, each crate will use include_str!="README.dm" macro to include the latest docs from the file.

I avoid extra work on local environments, this feature is hidden behind docs toggle, which is automatically enabled when building documentation for docs.rs.

mxpv commented 1 year ago

Also as a side bonus, README examples are not compilable, which makes it easier to track outdated code.

jsturtevant commented 1 year ago

the failure is #207, should we disable that test to unblock the PR's? Not sure why it didn't seem to be an issue on #181

mxpv commented 1 year ago

I looked but I didn't see where the docs get compiled on a PR, is it cargo doc that passes the feature?

I've updated CI to verify readmes with Github actions.

The docs feature is enabled when publishing to docs.rs via

[package.metadata.docs.rs]
 features = ["docs"]
jsturtevant commented 1 year ago

LGTM