#wrap #macro #formatting #typesetting #proc-macro #text-formatting #text

macro textwrap-macros-impl

Simple procedural macros to use textwrap utilities at compile time

8 releases

0.3.0 Nov 10, 2022
0.2.5 Feb 18, 2021
0.2.4 Jan 4, 2021
0.2.3 Jun 29, 2020
0.1.0 Jan 7, 2020

#43 in #text-formatting

Download history 570/week @ 2024-09-02 755/week @ 2024-09-09 297/week @ 2024-09-16 418/week @ 2024-09-23 714/week @ 2024-09-30 453/week @ 2024-10-07 376/week @ 2024-10-14 414/week @ 2024-10-21 555/week @ 2024-10-28 617/week @ 2024-11-04 395/week @ 2024-11-11 689/week @ 2024-11-18 579/week @ 2024-11-25 729/week @ 2024-12-02 1035/week @ 2024-12-09 500/week @ 2024-12-16

2,874 downloads per month
Used in 5 crates (via textwrap-macros)

MIT license

11KB
147 lines

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

~3MB
~59K SLoC