linurgy 0.6.0

Manipulate the output of multiple newlines. Replace/Insert/Append newlines with text. Input and output from stdio/files/buffers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// Double lines
fn main() {
    // create an editor that adds an empty line after each line
    let editor = linurgy::factory::appender("\n", 1);

    // note the single line breaks
    let input = "example line\nanother line\n";

    let output = editor.edit(input);

    // note the double line breaks
    let expected = "example line\n\nanother line\n\n";

    assert_eq!(expected, output);

    print!("input:\n{}\noutput:\n{}", input, output);
}