diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-06-09 00:37:13 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-06-09 00:37:13 +0200 |
| commit | 5afb42ad89abb518a01a09051f0f9b6f75bd383e (patch) | |
| tree | b12368a287f22de711df8d759c20ee742ed5b4c2 /tests/typ | |
| parent | d69dfa84ec957ac4037f60a3335416a9f73b97c8 (diff) | |
Lists with indent-based parsing
- Unordered lists with indent-based parsing and basic layout using stacks
- Headings are now also indent based
- Removes syntax functions since they will be superseded by select & transform
Diffstat (limited to 'tests/typ')
| -rw-r--r-- | tests/typ/code/include.typ | 2 | ||||
| -rw-r--r-- | tests/typ/markup/basic.typ | 12 | ||||
| -rw-r--r-- | tests/typ/markup/emph.typ | 12 | ||||
| -rw-r--r-- | tests/typ/markup/heading.typ | 48 | ||||
| -rw-r--r-- | tests/typ/markup/lists.typ | 45 | ||||
| -rw-r--r-- | tests/typ/markup/raw.typ | 8 | ||||
| -rw-r--r-- | tests/typ/markup/strong.typ | 12 |
7 files changed, 66 insertions, 73 deletions
diff --git a/tests/typ/code/include.typ b/tests/typ/code/include.typ index 945a041d..8080c6e8 100644 --- a/tests/typ/code/include.typ +++ b/tests/typ/code/include.typ @@ -13,7 +13,7 @@ // Expression as a file name. #let chap2 = include "import" + "able/chap" + "2.typ" -_ -- Intermission -- _ +-- _Intermission_ -- #chap2 { diff --git a/tests/typ/markup/basic.typ b/tests/typ/markup/basic.typ index 24c23e64..01582ceb 100644 --- a/tests/typ/markup/basic.typ +++ b/tests/typ/markup/basic.typ @@ -1,20 +1,10 @@ // Test basic markup. --- -#let linebreak() = [ - // Inside the old line break definition is still active. - #square(length: 3pt, fill: black) \ -] - A \ B \ C --- -// Paragraph breaks don't exist! -#let parbreak() = [ ] - -No more - -paragraph breaks +Paragraph breaks for you! diff --git a/tests/typ/markup/emph.typ b/tests/typ/markup/emph.typ index 8e25e7d3..048097a1 100644 --- a/tests/typ/markup/emph.typ +++ b/tests/typ/markup/emph.typ @@ -9,15 +9,3 @@ Partly em_phas_ized. // Scoped to body. #rect[_Scoped] to body. - ---- -#let emph = strong -_Strong_ - -#let emph() = "Hi" -_, _! - -#let emph = "hi" - -// Error: 1-2 expected function, found string -_ diff --git a/tests/typ/markup/heading.typ b/tests/typ/markup/heading.typ index 56f48bae..cffa6ed4 100644 --- a/tests/typ/markup/heading.typ +++ b/tests/typ/markup/heading.typ @@ -4,38 +4,21 @@ // Different number of hashtags. // Valid levels. -# 1 -### 2 -###### 6 +# Level 1 +### Level 2 +###### Level 6 // Too many hashtags. // Warning: 1-8 should not exceed depth 6 -####### 7 - ---- -// Heading continuation over linebreak. - -// Code blocks continue heading. -# A{ - "B" -} - -// Function call continues heading. -# #rect[ - A -] B - -// Without some kind of block, headings end at a line break. -# A -B +####### Level 7 --- // Heading vs. no heading. // Parsed as headings if at start of the context. -/**/ # Ok -{[## Ok]} -#rect[### Ok] +/**/ # Level 1 +{[## Level 2]} +#rect[### Level 3] // Not at the start of the context. No # heading @@ -44,9 +27,16 @@ No # heading \# No heading --- -// Make small, but double heading. -#let heading(contents) = heading(contents + contents, level: 6) +// While indented at least as much as the start, the heading continues. + +# This + is + indented. + +# This + is not. -// The new heading's argument list doesn't contain `level`. -// Error: 1-11 unexpected argument -### Twice. +// Code blocks continue heading. +# A { + "B" +} diff --git a/tests/typ/markup/lists.typ b/tests/typ/markup/lists.typ new file mode 100644 index 00000000..5c464ab8 --- /dev/null +++ b/tests/typ/markup/lists.typ @@ -0,0 +1,45 @@ +// Test lists. + +--- +_Shopping list_ +- Apples +- Potatoes +- Juice + +--- +- First level. + - Second level. + + There are multiple paragraphs. + - Third level. + + Still the same bullet point. + - Still level 2. +- At the top. + +--- +- Works + - Also with four spaces + - Or two tabs + +--- + - Top-level indent +- is fine. + +--- +Tightly +- surrounded +- by two +paragraphs. + +--- + - A + - B + - C + - D + +--- +- Level 1 + - Level [ +2 through template +] diff --git a/tests/typ/markup/raw.typ b/tests/typ/markup/raw.typ index cae3d261..005d413e 100644 --- a/tests/typ/markup/raw.typ +++ b/tests/typ/markup/raw.typ @@ -46,14 +46,6 @@ def hi(): ``` --- -// Make everything block-level. -#let raw(text) = raw(text, block: true) - -// The new raw's argument list doesn't contain `block`. -// Error: 6-10 unexpected argument -This `is` block-level. - ---- // Unterminated. // Error: 2:1 expected backtick(s) `endless diff --git a/tests/typ/markup/strong.typ b/tests/typ/markup/strong.typ index b487d06d..36695c48 100644 --- a/tests/typ/markup/strong.typ +++ b/tests/typ/markup/strong.typ @@ -9,15 +9,3 @@ Partly str*ength*ened. // Scoped to body. #rect[*Scoped] to body. - ---- -#let strong = emph -*Emph* - -#let strong() = "Bye" -*, *! - -#let strong = 123 - -// Error: 1-2 expected function, found integer -* |
