cargo/src/doc
Eric Huss 4cb9ac35bf Add network container tests 2023-01-14 15:10:16 -08:00
..
contrib Add network container tests 2023-01-14 15:10:16 -08:00
man Auto merge of #11561 - epage:typos, r=ehuss 2023-01-11 14:15:24 +00:00
semver-check docs: add `run-fail` to semver check 2022-01-12 20:43:14 +01:00
src doc(unstable): add `codegen-backend` to the list of unstable features 2023-01-14 11:14:41 +00:00
theme 🍱 Crop favicon 2021-03-14 13:05:28 -04:00
.gitignore Git ignore built Cargo book. 2019-04-22 20:18:17 +01:00
README.md Add chapters on dependency resolution and SemVer compatibility. 2020-08-10 11:00:58 -07:00
book.toml book: add edit links to specific pages 2021-11-28 11:41:17 +03:00
build-man.sh Allow running build-man.sh from any directory 2020-09-06 12:09:15 -07:00

README.md

Cargo documentation

This directory contains Cargo's documentation. There are two parts, The Cargo Book which is built with mdbook and the man pages, which are built with mdman.

Building the book

Building the book requires mdBook. To get it:

$ cargo install mdbook

To build the book:

$ mdbook build

mdbook provides a variety of different commands and options to help you work on the book:

  • mdbook build --open: Build the book and open it in a web browser.
  • mdbook serve: Launches a web server on localhost. It also automatically rebuilds the book whenever any file changes and automatically reloads your web browser.

The book contents are driven by the SUMMARY.md file, and every file must be linked there.

Building the man pages

The man pages use a tool called mdman to convert markdown to a man page format. Check out the documentation at mdman/doc/ for more details.

The man pages are converted from a templated markdown (located in the src/doc/man/ directory) to three different formats:

  1. Troff-style man pages, saved in src/etc/man/.
  2. Markdown (with some HTML) for the Cargo Book, saved in src/doc/src/commands/.
  3. Plain text (needed for embedded man pages on platforms without man such as Windows), saved in src/doc/man/generated_txt/.

To rebuild the man pages, run the script build-man.sh in the src/doc directory.

$ ./build-man.sh

SemVer chapter tests

There is a script to verify that the examples in the SemVer chapter work as intended. To run the tests, go into the semver-check directory and run cargo run.

Contributing

We'd love your help with improving the documentation! Please feel free to open issues about anything, and send in PRs for things you'd like to fix or change. If your change is large, please open an issue first, so we can make sure that it's something we'd accept before you go through the work of getting a PR together.