Skip to content

Commit

Permalink
[WIP] Switch to perevir for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tarleb committed Sep 1, 2024
1 parent 1effc50 commit 7591527
Show file tree
Hide file tree
Showing 20 changed files with 211 additions and 249 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ jobs:
uses: actions/checkout@v2

- name: Install dependencies
run: apk add make
run: apk add luarocks-5.4 make

- name: Install perevir
run: |
eval $(luarocks-5.4 path)
luarocks-5.4 perevir
- name: Test
run: make test
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@ DIFF ?= diff
PANDOC ?= pandoc

.PHONY: test
test: test-hrule test-in-div test-two-sections

test-%: $(FILTER_FILE) test/input-%.md test/test-%.yaml
@$(PANDOC) --defaults test/test-$*.yaml | \
$(DIFF) test/expected-$*.md -
test:
pandoc lua test/runtests.lua test/perevirky
34 changes: 0 additions & 34 deletions test/expected-hrule.md

This file was deleted.

33 changes: 0 additions & 33 deletions test/expected-in-div.md

This file was deleted.

13 changes: 0 additions & 13 deletions test/expected-shifted-headings.md

This file was deleted.

29 changes: 0 additions & 29 deletions test/expected-two-sections.md

This file was deleted.

36 changes: 0 additions & 36 deletions test/input-hrule.md

This file was deleted.

32 changes: 0 additions & 32 deletions test/input-in-div.md

This file was deleted.

13 changes: 0 additions & 13 deletions test/input-shifted-headings.md

This file was deleted.

37 changes: 0 additions & 37 deletions test/input-two-sections.md

This file was deleted.

50 changes: 50 additions & 0 deletions test/perevirky/hrule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Normally, the abstract ends when a new section begins. However, no
all documents start with a section. An horizontal rule can be used
mark the end of the abstract in such a case.

``` markdown {#input}
::: {.frontmatter}
# Abstract

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
officia deserunt mollit anim id est laborum.

---

Mauris vel erat tincidunt, venenatis elit ac, luctus augue.
Aliquam sed hendrerit augue. Donec finibus mi et dolor semper, non
malesuada nulla ullamcorper.
:::

# Lorem Ipsum

Quo dolore molestiae et laboriosam occaecati explicabo corrupti.
Earum expedita ducimus quaerat est quam ut molestiae. Illum
deleniti vel labore facilis et cum est. Est nemo est vel ad.
```

``` markdown {#output}
---
abstract: |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
officia deserunt mollit anim id est laborum.
---

::: frontmatter
Mauris vel erat tincidunt, venenatis elit ac, luctus augue. Aliquam sed
hendrerit augue. Donec finibus mi et dolor semper, non malesuada nulla
ullamcorper.
:::

# Lorem Ipsum

Quo dolore molestiae et laboriosam occaecati explicabo corrupti. Earum
expedita ducimus quaerat est quam ut molestiae. Illum deleniti vel
labore facilis et cum est. Est nemo est vel ad.
```
49 changes: 49 additions & 0 deletions test/perevirky/in-div.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Abstract nested in a div

The abstract section can be nested below a div.

``` markdown {#input}
::: {.frontmatter}
# Abstract

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
deserunt mollit anim id est laborum.

# Preface

* Phasellus purus.
* Praesent fermentum tempor tellus.
* Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus.
:::

# Lorem Ipsum

Quo dolore molestiae et laboriosam occaecati explicabo corrupti.
Earum expedita ducimus quaerat est quam ut molestiae. Illum
deleniti vel labore facilis et cum est.
```

As with other placements of the abstract, it is removed from the
main document and placed in the metadata.

``` markdown {#output}
---
abstract: |
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
officia deserunt mollit anim id est laborum.
---

::: frontmatter
# Preface

- Phasellus purus.
- Praesent fermentum tempor tellus.
- Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus.
:::

# Lorem Ipsum

Quo dolore molestiae et laboriosam occaecati explicabo corrupti. Earum
expedita ducimus quaerat est quam ut molestiae. Illum deleniti vel
labore facilis et cum est.
```
5 changes: 5 additions & 0 deletions test/perevirky/perevir.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
filters:
- abstract-section.lua
ignore-softbreaks: true
---
Loading

0 comments on commit 7591527

Please sign in to comment.