diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-11-16 10:37:30 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-11-16 10:37:30 +0100 |
| commit | 261ef9e33a8548d4b7aa53e69e71866648982ae8 (patch) | |
| tree | 8c98eeb4a4bb2123b45baf1dd4de706a21d619e9 /src/library/structure.rs | |
| parent | 0917d89bb899380ba897382b4945c8426f25c66d (diff) | |
Generalize tree layouter 🌲
Diffstat (limited to 'src/library/structure.rs')
| -rw-r--r-- | src/library/structure.rs | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/library/structure.rs b/src/library/structure.rs index e6d242a0..2bcd2744 100644 --- a/src/library/structure.rs +++ b/src/library/structure.rs @@ -1,30 +1,36 @@ use crate::func::prelude::*; use Command::*; -/// 📜 `page.break`: Ends the current page. +/// ↩ `line.break`, `n`: Ends the current line. #[derive(Debug, PartialEq)] -pub struct Pagebreak; +pub struct Linebreak; function! { - data: Pagebreak, + data: Linebreak, parse: plain, - - layout(_, _) { - Ok(commands![FinishLayout]) - } + layout(_, _) { Ok(commands![FinishFlexRun]) } } -/// 🔙 `line.break`, `n`: Ends the current line. +/// ↕ `paragraph.break`: Ends the current paragraph. +/// +/// This has the same effect as two subsequent newlines. #[derive(Debug, PartialEq)] -pub struct Linebreak; +pub struct Parbreak; function! { - data: Linebreak, + data: Parbreak, parse: plain, + layout(_, _) { Ok(commands![FinishFlexLayout]) } +} - layout(_, _) { - Ok(commands![FinishFlexRun]) - } +/// 📜 `page.break`: Ends the current page. +#[derive(Debug, PartialEq)] +pub struct Pagebreak; + +function! { + data: Pagebreak, + parse: plain, + layout(_, _) { Ok(commands![FinishLayout]) } } /// 📐 `align`: Aligns content in different ways. |
