#markdown #readme #include


Include other documents, table of content, or rust-doc in Markdown using a simple template system

2 releases

0.1.1 Apr 6, 2023
0.1.0 Mar 9, 2023

#765 in Text processing

Download history 26/week @ 2023-03-08 1/week @ 2023-03-15 19/week @ 2023-03-29 65/week @ 2023-04-05 27/week @ 2023-04-12 6/week @ 2023-04-19 21/week @ 2023-04-26 11/week @ 2023-05-03 12/week @ 2023-05-10 11/week @ 2023-05-17

57 downloads per month
Used in 3 crates

MIT license



Table of contents

A simple way of including other files, rust doc and table of content in a markdown file.

For a repo's README file, you'll create a README.tpl.md which you can edit like a normal markdown file, but with the added support for fenced includes which are TOML fences with an extra name containing the configuration of the include.


The rustdoc part of this crate is based on modified code from cargo-rdme. The same limitations apply, especially for the syntax of intralinks



My title

Include a table of content:
```toml toc
header = "# Table of contents"

Extracted from lib.rs' rust doc:

```toml rustdoc
source = "lib.rs"

To generate a README.md file you add a test:

fn update_readme() {
    markdown_includes::update("src/README.tpl.md", "README.md").unwrap();

This test will update the README file if necessary, but if running in a CI pipeline (the CI environment variable is set), it will fail if the README.md needs updating.


~81K SLoC