#text-formatting #proc-macro #compile-time #text #formatting #macro #typesetting

no-std textwrap-macros

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

#487 in Text processing

Download history 666/week @ 2024-11-15 564/week @ 2024-11-22 665/week @ 2024-11-29 996/week @ 2024-12-06 619/week @ 2024-12-13 218/week @ 2024-12-20 353/week @ 2024-12-27 362/week @ 2025-01-03 421/week @ 2025-01-10 581/week @ 2025-01-17 568/week @ 2025-01-24 879/week @ 2025-01-31 1035/week @ 2025-02-07 886/week @ 2025-02-14 661/week @ 2025-02-21 561/week @ 2025-02-28

3,273 downloads per month
Used in 7 crates (5 directly)

MIT license

14KB

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

~3.5MB
~63K SLoC