Crates.io | cargo-sync-rdme |
lib.rs | cargo-sync-rdme |
version | |
source | src |
created_at | 2022-09-11 13:22:01.306963 |
updated_at | 2024-11-30 15:59:55.874385 |
description | Cargo subcommand to synchronize README with crate documentation |
homepage | |
repository | https://github.com/gifnksm/cargo-sync-rdme |
max_upload_size | |
id | 663040 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Cargo subcommand to synchronize README with the cargo manifest and crate documentation.
There are multiple ways to install cargo-sync-rdme. Choose any one of the methods below that best suits your needs.
Executable binaries are available for download on the GitHub Release page.
To build cargo-sync-rdme executable from the source, you must have the Rust toolchain installed. To install the rust toolchain, follow this guide.
Once you have installed Rust, the following command can be used to build and install cargo-sync-rdme:
# Install released version
$ cargo install cargo-sync-rdme
# Install latest version
$ cargo install --git https://github.com/gifnksm/cargo-sync-rdme.git cargo-sync-rdme
cargo-sync-rdme is a subcommand to synchronize the contents of README.md with the cargo manifest and crate documentation. By embedding marker comments in README.md, you can insert the documentation generated by cargo-sync-rdme. There are three types of marker comments as follows.
<!-- cargo-sync-rdme title -->
: generate document title (H1 element) from package name.<!-- cargo-sync-rdme badge -->
: generate badges from package metadata.<!-- cargo-sync-rdme rustdoc -->
: generate documentation for a crate from document comments.Write the README.md as follows:
<!-- cargo-sync-rdme title -->
<!-- cargo-sync-rdme badge -->
<!-- cargo-sync-rdme rustdoc -->
To update the contents of README.md, run the following:
cargo sync-rdme --toolchain nightly
cargo-sync-rdme uses the unstable features of rustdoc, so nightly toolchain is required to generate READMEs from comments in the crate documentation. If nightly toolchain is not installed, it can be installed with the following command
rustup toolchain install nightly
The contents of README.md will be updated as follows:
<!-- cargo-sync-rdme title [[ -->
# (Package name)
<!-- cargo-sync-rdme ]] -->
<!-- cargo-sync-rdme badge [[ -->
(Badges)
<!-- cargo-sync-rdme ]] -->
<!-- cargo-sync-rdme rustdoc [[ -->
(Crate documentation)
<!-- cargo-sync-rdme ]] -->
See examples/lib for actual examples.
You can customize the behavior of cargo-sync-rdme by adding the following section to Cargo.toml
.
[package.metadata.cargo-sync-rdme.badges]
maintenance = true
license = true
[package.metadata.cargo-sync-rdme.rustdoc]
html-root-url = "https://gifnksm.github.io/cargo-sync-rdme/"
See Configuration for details.
The minimum supported Rust version is Rust 1.78.0. At least the last 3 versions of stable Rust are supported at any given time.
While a crate is a pre-release status (0.x.x) it may have its MSRV bumped in a patch release. Once a crate has reached 1.x, any MSRV bump will be accompanied by a new minor version.
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
See CONTRIBUTING.md.