text-block-macros 0.1.0

Create a multiline string literal
Documentation

Text Block Macros

Test Crates.io Version

Create a multiline string literal.

Usage Examples

Create a block of text without final newline

use text_block_macros::text_block;
let text = text_block! {
  "abc"
  "def"
  "ghi"
};
assert_eq!(text, "abc\ndef\nghi");

Create a block of text that ends with a newline

use text_block_macros::text_block_fnl;
let text = text_block_fnl! {
  "abc"
  "def"
  "ghi"
};
assert_eq!(text, "abc\ndef\nghi\n");

License

MIT © Hoàng Văn Khải.