Workspace usage error
When I try to use cargo readme in a workspace directory I get this error:
Error: missing field
pathfor keylibat line 23 column 1
I have a workspace with many crates in it, and I'd like to generate individual README.mds for each one. I've tried both:
-
cargo readme -r subcrate > subcrate/README.md -
(cd subcrate ; cargo readme > README.md)
With the same error message.
This is the workspace: https://github.com/emilk/egui/
I encountered this same error message when I had a [lib] section that did not contain an explicit path = "src/lib.rs". Removing the entire [lib] section or adding path both circumvented this error.
I ran into the same issue.. I used a pre-commit hook to fix it with this code:
# Get the root directory
BASE=$(git rev-parse --show-toplevel)
# Update README.md
pushd $BASE/h2gb > /dev/null
# Do the main README.md
cargo readme -o $BASE/README.md
But it would be nice if it could cleanly handle workspaces!