#text-formatting #proc-macro #text #formatting #macro #compile-time #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

#401 in Text processing

Download history 1842/week @ 2024-03-14 1303/week @ 2024-03-21 2264/week @ 2024-03-28 2656/week @ 2024-04-04 2925/week @ 2024-04-11 2120/week @ 2024-04-18 1789/week @ 2024-04-25 654/week @ 2024-05-02 532/week @ 2024-05-09 1163/week @ 2024-05-16 867/week @ 2024-05-23 995/week @ 2024-05-30 758/week @ 2024-06-06 738/week @ 2024-06-13 690/week @ 2024-06-20 756/week @ 2024-06-27

3,119 downloads per month
Used in 4 crates

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

~2MB
~38K SLoC