bunogi / cargo-makedocs Goto Github PK
View Code? Open in Web Editor NEWA cargo subcommand to build documentation for development easier
License: MIT License
A cargo subcommand to build documentation for development easier
License: MIT License
The following cargo.toml and cargo.lock causes cargo-makedocs to not be able to pick the correct version.
[dependencies]
log = "0.4.0"
env_logger = "0.5.13"
actix = "0.7.5"
actix-web = "0.7.13"
listenfd = "0.3.3"
diesel = { version = "1.0.0", features = ["postgres"] }
dotenv = "0.9.0"
[[package]]
name = "diesel"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"diesel_derives 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pq-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
Inlining the repro.sh
I have in my MRE repo for this issue:
cargo-makedocs
looks like an interesting tool, but it doesn't seem to work with Cargo workspaces yet.
Steps to reproduce:
binary
and make it a new Cargo binary.dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)"
cd "$dir"
NEW_WORKSPACE_NAME="new-workspace"
NEW_MEMBER_NAME="binary"
if [ -e "$NEW_WORKSPACE_NAME" ]; then
rm -rf "$NEW_WORKSPACE_NAME" || exit $?
fi
cargo new "$NEW_WORKSPACE_NAME" || exit $?
cd "$NEW_WORKSPACE_NAME" || exit $?
rm -rf *
cat > Cargo.toml <<-EOF || exit $?
[workspace]
members = ['$NEW_MEMBER_NAME']
EOF
cargo new --bin $NEW_MEMBER_NAME || exit $?
cargo build || exit $?
cargo makedocs
on workspace root, expecting it to fail because a concrete workspace member should be used to generate docs.TEMP_CARGO_INSTALL_ROOT="$dir/cargo-install-root"
if [ -e "$TEMP_CARGO_INSTALL_ROOT" ]; then
rm -rf "$TEMP_CARGO_INSTALL_ROOT" || exit $?
fi
mkdir "$TEMP_CARGO_INSTALL_ROOT" || exit $?
export PATH="$PATH:$TEMP_CARGO_INSTALL_ROOT/bin"
cargo install --root "$TEMP_CARGO_INSTALL_ROOT" cargo-makedocs || exit $?
cargo makedocs && { echo "expected \`cargo makedocs\` to fail at workspace root!"; exit 1; }
echo "^ This failure is expected -- it's the workspace root. :)"
binary
workspace member. Let's try to use makedocs
on it, expecting this to work.cd "$NEW_MEMBER_NAME"
cargo makedocs || exit $?
Unfortunately, the above invocation fails, complaining that Cargo.lock
couldn't be found. Cargo.lock
DOES exist, but at the workspace root and not this working directory. This seems to indicate that makedocs
simply isn't aware of workspaces yet.
I'll see if I can write up a PR to fix this
Either the option is build all dependencies, or build none of them and have no links, why not simply link dependencies on doc.rs?
This happens when one's using the same crate in different versions and has renamed one of them. This should lead to an error message explaining how to fix it (by using the -e
flag).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.