textwrap-macros
Simple procedural macros to use [textwrap
] utilities at compile time.
Add the textwrap-macros
crate to the Cargo.toml
manifest:
toml
[dependencies]
textwrap-macros = "0.2"
Then either use the macros using the old-style #[macro_use]
or import them as
any other crate member:
```rust
use textwrap_macros::dedent;
const poem: &str = dedent!(r#" When we two parted In silence and tears, Half broken-hearted To sever for years, Pale grew thy cheek and cold, Colder thy kiss; Truly that hour foretold Sorrow to this. "#); ```
Macros usage with small examples can be found on
docs.rs
. The following functions have been
ported into macros:
dedent
](https://docs.rs/textwrap-macros/latest/textwrap_macros/macro.dedent.html)fill
](https://docs.rs/textwrap-macros/latest/textwrap_macros/macro.fill.html)indent
](https://docs.rs/textwrap-macros/latest/textwrap_macros/macro.indent.html)wrap
](https://docs.rs/textwrap-macros/latest/textwrap_macros/macro.wrap.html)unfill
](https://docs.rs/textwrap/latest/textwrap/fn.unfill.html)refill
](https://docs.rs/textwrap/latest/textwrap/fn.refill.html)wrap_columns
](https://docs.rs/textwrap/latest/textwrap/fn.wrap_columns.html)Check out the documentation of the original library for more information about the behaviour of each of the wrapped functions.
This project adheres to Semantic Versioning and provides a changelog in the Keep a Changelog format.