#markdown #documentation #testing

dev docmatic

Test Rust examples in your documentation

2 releases

Uses old Rust 2015

0.1.2 Apr 25, 2018
0.1.1 Apr 17, 2018

#648 in Development tools

Download history 48/week @ 2021-02-23 34/week @ 2021-03-02 27/week @ 2021-03-09 47/week @ 2021-03-16 41/week @ 2021-03-23 18/week @ 2021-03-30 35/week @ 2021-04-06 39/week @ 2021-04-13 34/week @ 2021-04-20 25/week @ 2021-04-27 26/week @ 2021-05-04 47/week @ 2021-05-11 20/week @ 2021-05-18 29/week @ 2021-05-25 24/week @ 2021-06-01 28/week @ 2021-06-08

153 downloads per month
Used in less than 8 crates

MIT license

10KB
54 lines

docmatic

Be dogmatic about working documentation.

Build Status Build status Documentation License Crates.io

Usage

First, add this to your Cargo.toml:

[dev-dependencies]
docmatic = "0.1"

Next, in your test file:

extern crate docmatic;

fn test_readme() {
    docmatic::assert_file("README.md");
}

For more information on using docmatic, look at the documentation

Why Docmatic?

Compared to doing nothing:

  • When you have stale documentation, it gives a sour taste to those considering your crate

Compared to #![doc(include = "../README.md")]

  • Allows your README to focus on potential contributors and your API docs on potential users
  • Doesn't require nightly

Compared to rustdoc -L target/debug/deps/ --test README.md

  • For docmatic:
    • Easier for contributors to know how to run
  • For rustdoc:
    • Simple
    • No dependencies to muck with

Compared to skeptic:

  • For docmatic:
    • Fewer dependencies for faster build
    • Doesn't require exposing those dependencies to your users via a [build-dependencies]
    • Runs in the expected working directory
  • For skeptic:
    • Skeptic templates
    • Better integration with cargo test (each block is a distinct test)

License

docmatic is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, and LICENSE-MIT for details.

Credits

We're grateful for all of the work done on skeptic, the spiritual predecessor to docmatic and the work of people iterating on a lighter weight solution.

Dependencies

~3.5MB
~70K SLoC