Skip to main content

blank_line

Function blank_line 

Source
pub fn blank_line() -> Box<Layout>
Expand description

Creates a blank line (double line break).

This is a convenience function that creates two consecutive line breaks, resulting in a blank line in the output. It’s equivalent to line(line(null(), null()), null()) and is useful for separating sections of content with whitespace.

§Returns

A boxed [Layout::Line] that produces a blank line.

§Examples

use typeset::*;

// Separate sections with blank lines
let document = comp(
    text_str("Section 1"),
    comp(
        blank_line(),
        text_str("Section 2"),
        false, false
    ),
    false, false
);

let result = format_layout(document, 2, 80);
// Output:
// Section 1
//
// Section 2
use typeset::*;

// Multiple blank lines for spacing
let spaced = join_with(vec![
    text_str("Header"),
    text_str("Body"),
    text_str("Footer")
], blank_line());

// Creates well-separated sections

§See Also

  • newline - For single line breaks
  • line() - The underlying line break constructor
  • [join_with_lines] - For single-line separation