#wrap #macro #proc-macro #formatting #typesetting #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

#32 in #text-formatting

Download history 1469/week @ 2023-12-04 1549/week @ 2023-12-11 1686/week @ 2023-12-18 478/week @ 2023-12-25 900/week @ 2024-01-01 1603/week @ 2024-01-08 1790/week @ 2024-01-15 1975/week @ 2024-01-22 2080/week @ 2024-01-29 2265/week @ 2024-02-05 2675/week @ 2024-02-12 1702/week @ 2024-02-19 1321/week @ 2024-02-26 1692/week @ 2024-03-04 2267/week @ 2024-03-11 1370/week @ 2024-03-18

6,771 downloads per month
Used in 4 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

~1.5MB
~37K SLoC