#text #formatting #wrap #typesetting #macro

textwrap-macros

Simple procedural macros to use textwrap utilities at compile time

7 releases

new 0.2.5 Feb 18, 2021
0.2.4 Jan 4, 2021
0.2.3 Jun 29, 2020
0.2.2 Apr 10, 2020
0.1.0 Jan 7, 2020

#89 in Text processing

Download history 16/week @ 2020-11-04 21/week @ 2020-11-11 19/week @ 2020-11-18 21/week @ 2020-11-25 29/week @ 2020-12-02 16/week @ 2020-12-09 7/week @ 2020-12-16 32/week @ 2020-12-23 20/week @ 2020-12-30 25/week @ 2021-01-06 24/week @ 2021-01-13 16/week @ 2021-01-20 9/week @ 2021-01-27 8/week @ 2021-02-03 18/week @ 2021-02-10 159/week @ 2021-02-17

88 downloads per month
Used in 3 crates

MIT license

11KB

textwrap-macros Star me

Simple procedural macros to use textwrap utilities at compile time.

Actions Codecov License Source Crate Documentation Changelog

Usage

Add the textwrap-macros crate to the Cargo.toml manifest:

[dependencies]
textwrap-macros = "0.2"

Then either use the macros using the old-style #[macro_use] or import them as any other crate member:

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:

Check out the documentation of the original library for more information about the behaviour of each of the wrapped functions.

Changelog

This project adheres to Semantic Versioning and provides a changelog in the Keep a Changelog format.

Dependencies

~0.6–1MB
~23K SLoC