include-utils

nameinclude-utils
created_at2023-12-29 10:13:47.418862
updated_at2023-12-29 10:22:21.276343
downloads100
descriptionmdBook-like include macro as the powerful replacement for the standard `include_str` macro.
homepagehttps://github.com/alekseysidorov/include-utils
repository
max_upload_size
id1083158
Aleksey Sidorov

documentation

https://docs.rs/include-utils

readme

# Include utils A more powerful replacement for the standard `inlcude_str` macros. Often you only need a specific part of the file, e.g. relevant lines for an example, or section of README.md. This crate provides macros that can include only part of a file, similar to the [mdbook] specific feature. Imagine that you want to include "usage" section from your repository readme file to the crate documentation. But you do not want to see in crate documentation some parts of readme file, like header, badges, etc. With the [`include_str`] macro you can only include the entire file content. But with the [`include_md`] macro you can include only a specific section of the file. _**Note!** Unlike the built-in macro, this macros uses the `CARGO_MANIFEST_DIR` as the current directory instead of the directory from which macro is called._ ## Usage ```rust //! # Crate overview //! #![doc = include_utils::include_md!("README.md:description")] //! //! ## Other section ``` [mdbook]: https://rust-lang.github.io/mdBook/format/mdbook.html#including-portions-of-a-file [`include_str`]: https://doc.rust-lang.org/stable/std/macro.include_str.html
Commit count: 0

cargo fmt