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

no-std textwrap-macros

简单的过程宏,用于在编译时使用 textwrap 工具

8 个版本

0.3.0 2022 年 11 月 10 日
0.2.5 2021 年 2 月 18 日
0.2.4 2021 年 1 月 4 日
0.2.3 2020 年 6 月 29 日
0.1.0 2020 年 1 月 7 日

#401 in 文本处理

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 每月下载量
4 crates 中使用

MIT 许可证

14KB

textwrap-macros Star me

简单的过程宏,用于在编译时使用 textwrap 工具。

Actions Codecov License Source Crate Documentation Changelog

用法

textwrap-macros crate 添加到 Cargo.toml 清单

[dependencies]
textwrap-macros = "0.2"

然后使用旧式 #[macro_use] 或将其作为任何其他 crate 成员导入

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.
"#);

有关宏用法的小示例,请参阅 docs.rs。以下函数已转换为宏

有关包装函数的更多行为信息,请参阅原始库的 文档

变更日志

此项目遵循 语义版本控制 并提供 变更日志,格式为 Keep a Changelog

依赖项

~2MB
~38K SLoC