# cargo-cite This is a simple cargo command that emulates the functionality of bibtex citing in latex, but for rust documentation. After installation, the command ```bash cargo cite --bib ref.bib ``` takes in a bib file and transforms the crate documentation to include the proper citations. E.g. it transforms this ```rust /// Main function /// /// That includes a citation [^@simple] fn main() { ... }; ``` to this ```rust /// Main function /// /// That includes a citation [^@simple] /// /// [^@simple]: Doe, John, and Jane Smith. “A Very Simple Title.” The Journal of Rust, May 2013 fn main() { ... }; ``` which then using rustdoc renders as ![Rendered citation](assets/docs.png) The command can be ran consecutively and will update with any changes in documentation/citations/etc without duplications. ## Installation ```bash cargo install cargo-cite ``` This will place `cargo-cite` in your cargo binary directory (generally `~/.cargo/bin/`). It can then be used as either `cargo cite` or `cargo-cite`. ## Usage You can cite anything in your bib file using `[^@citekey]`, essentially your citekey inside of a footnote. `cargo cite` will then add the proper citation to the bottom of the documentation as a footnote. This allows the citation to live close to the text it is referencing. It additionally comes with a hand of options for citation style (see [here](https://docs.rs/hayagriva/latest/src/hayagriva/csl/archive.rs.html#340-431) for supported styles, courtesy of typst/hayagriva), verbosity, and file/folder specification. ```bash Usage: cargo-cite [OPTIONS] --bib Options: -b, --bib Bibtex file with citations -s, --style