webern / cargo-readme

Generate README.md from docstrings
Other
360 stars 57 forks source link

Use `cargo_metadata` to get manifest data #82

Open oeb25 opened 1 year ago

oeb25 commented 1 year ago

This commit uses the cargo_metadata crate to derive information about the crate, as opposed to only parsing Cargo.toml.

In particular, this helps when fields in the manifest are inherited from the workspace, for example if version = { workspace = true }.

One thing cargo_metadata does not provide, is badges, so these are still parsed from Cargo.toml.

The error messages also changed as a result of propagating the errors from cargo_metadata, and thus some of the tests had to be altered.