📄Arrow Blocks

You already know one way to write text: On the same line of an element.

Corgi also has another way to write longer lines of text: Arrow Blocks

All HTML you will see on this page will be the actual HTML that corgi generates, not pretty-printed HTML to make you familiar with how corgi controls whitespace.

p
  > Everything in here
    belongs to the same
    p tag.
p
  > And so does everything
    that is written
  em  in here
  >  and here
    as well

Leading whitespace after indentation will be preserved, as will all but the last newline. Other trailing whitespace will not be preserved.

An empty Arrow Block produces a single newline.

Technical Note: Corgi will always generate HTML with Unix-style line endings (LF), even if the corgi file uses CRLF.

Whitespace Control

Apart from the whitespace in text (which is handled as described above), corgi does not add any whitespace between elements, even if there is in the corgi file. This means, corgi removes all indentation or other whitespace, such as empty lines between elements.

As a result, the closing tag of an element will touch the opening tag of the next.

You can use empty arrow blocks to insert whitespace where you need it.

Additionally, you'll learn another way to insert whitespace when you learn about interpolation.

Last updated