Skip to content

Commit

Permalink
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 1c4e5fa
Show file tree
Hide file tree
Showing 20 changed files with 211 additions and 251 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:
pandoc:
- edge
- latest
# This should be the oldest version that's supported
# - 2.19.2

container:
image: pandoc/core:${{ matrix.pandoc }}
Expand All @@ -40,7 +38,12 @@ jobs:
uses: actions/checkout@v2

- name: Install dependencies
run: apk add make
run: apk add luarocks5.4 make

- name: Install perevir
run: |
eval $(luarocks-5.4 path)
luarocks-5.4 install 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 1c4e5fa

Please sign in to comment.