Added tests
2
.gitignore
vendored
@ -5,6 +5,8 @@ private/
|
|||||||
# build folder
|
# build folder
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
|
.idea
|
||||||
|
|
||||||
# contains unit tests (incomplete at the moment, so don't include them)
|
# contains unit tests (incomplete at the moment, so don't include them)
|
||||||
test/
|
test/
|
||||||
test/.idea/
|
test/.idea/
|
||||||
|
@ -14,7 +14,7 @@ containsElement () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# these examples are skipped because they don't run on travis (for now)
|
# these examples are skipped because they don't run on travis (for now)
|
||||||
skippedExamples=("language-chinese" "language-japanese")
|
skippedExamples=("language-chinese" "language-japanese", "language-persian")
|
||||||
|
|
||||||
# loop all files in the current folder
|
# loop all files in the current folder
|
||||||
for f in *; do
|
for f in *; do
|
||||||
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 462 KiB After Width: | Height: | Size: 466 KiB |
Before Width: | Height: | Size: 265 KiB After Width: | Height: | Size: 265 KiB |
38
tests/build-tests.sh
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "##"
|
||||||
|
echo "# building tests"
|
||||||
|
echo "##"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
containsElement () {
|
||||||
|
local e match="$1"
|
||||||
|
shift
|
||||||
|
for e; do [[ "$e" == "$match" ]] && return 0; done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# these examples are skipped because they don't run on travis (for now)
|
||||||
|
skippedExamples=()
|
||||||
|
|
||||||
|
# loop all files in the current folder
|
||||||
|
for f in *; do
|
||||||
|
# run only for folders
|
||||||
|
if [ -d "$f" ]; then
|
||||||
|
|
||||||
|
if containsElement "$f" "${skippedExamples[@]}"; then
|
||||||
|
echo "skipping '$f'"
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
echo "building '$f'"
|
||||||
|
cd "$f"
|
||||||
|
echo " - running pandoc build script"
|
||||||
|
bash "$PWD/build.sh"
|
||||||
|
echo " - generating preview"
|
||||||
|
pdftoppm -r 150 -png "document.pdf" > "preview.png"
|
||||||
|
echo ""
|
||||||
|
cd ".."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
1
tests/heading/build.sh
Normal file
@ -0,0 +1 @@
|
|||||||
|
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
32
tests/heading/document.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
title: "Test: Heading"
|
||||||
|
author: [Author]
|
||||||
|
date: "2022-11-24"
|
||||||
|
subject: "Markdown"
|
||||||
|
keywords: [Markdown, Example, Text, Heading]
|
||||||
|
lang: "en"
|
||||||
|
...
|
||||||
|
|
||||||
|
# Test: Heading
|
||||||
|
|
||||||
|
## Setext-style headings
|
||||||
|
|
||||||
|
level one
|
||||||
|
=========
|
||||||
|
|
||||||
|
level two
|
||||||
|
---------
|
||||||
|
|
||||||
|
## ATX-style headings
|
||||||
|
|
||||||
|
# level one
|
||||||
|
|
||||||
|
## level two
|
||||||
|
|
||||||
|
### level three
|
||||||
|
|
||||||
|
#### level four
|
||||||
|
|
||||||
|
##### level five
|
||||||
|
|
||||||
|
###### level six
|
BIN
tests/heading/document.pdf
Normal file
BIN
tests/heading/preview.png
Normal file
After Width: | Height: | Size: 41 KiB |
1
tests/horizontal-rule/build.sh
Normal file
@ -0,0 +1 @@
|
|||||||
|
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
28
tests/horizontal-rule/document.md
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
title: "Test: Horizontal Rule"
|
||||||
|
author: [Author]
|
||||||
|
date: "2022-11-24"
|
||||||
|
subject: "Markdown"
|
||||||
|
keywords: [Markdown, Example, Text, Horizontal Rule]
|
||||||
|
lang: "en"
|
||||||
|
...
|
||||||
|
|
||||||
|
# Test: Horizontal Rule
|
||||||
|
|
||||||
|
## Horizontal Rule with `*` (asterisk)
|
||||||
|
|
||||||
|
****
|
||||||
|
|
||||||
|
**********
|
||||||
|
|
||||||
|
## Horizontal Rule with `-` (minus)
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
## Horizontal Rule with `_` (underscore)
|
||||||
|
|
||||||
|
____
|
||||||
|
|
||||||
|
__________
|
BIN
tests/horizontal-rule/document.pdf
Normal file
BIN
tests/horizontal-rule/preview.png
Normal file
After Width: | Height: | Size: 37 KiB |
1
tests/list-definition/build.sh
Normal file
@ -0,0 +1 @@
|
|||||||
|
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
29
tests/list-definition/document.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
title: "Test: Definition List"
|
||||||
|
author: [Author]
|
||||||
|
date: "2022-11-24"
|
||||||
|
subject: "Markdown"
|
||||||
|
keywords: [Markdown, Example, Text, List, Definition List]
|
||||||
|
lang: "en"
|
||||||
|
...
|
||||||
|
|
||||||
|
# Test: Definition List
|
||||||
|
|
||||||
|
## Definition List with single definition
|
||||||
|
|
||||||
|
Apple
|
||||||
|
: Pomaceous fruit of plants of the genus Malus in
|
||||||
|
the family Rosaceae.
|
||||||
|
|
||||||
|
Orange
|
||||||
|
: The fruit of an evergreen tree of the genus Citrus.
|
||||||
|
|
||||||
|
## Definition List with multiple definitions
|
||||||
|
|
||||||
|
Apple
|
||||||
|
: Pomaceous fruit of plants of the genus Malus in
|
||||||
|
the family Rosaceae.
|
||||||
|
: An American computer company.
|
||||||
|
|
||||||
|
Orange
|
||||||
|
: The fruit of an evergreen tree of the genus Citrus.
|
BIN
tests/list-definition/document.pdf
Normal file
BIN
tests/list-definition/preview.png
Normal file
After Width: | Height: | Size: 65 KiB |
1
tests/list-ordered/build.sh
Normal file
@ -0,0 +1 @@
|
|||||||
|
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
43
tests/list-ordered/document.md
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
title: "Lists"
|
||||||
|
author: [Author]
|
||||||
|
date: "2022-11-24"
|
||||||
|
subject: "Markdown"
|
||||||
|
keywords: [Markdown, Example, Text, List, Ordered List]
|
||||||
|
lang: "en"
|
||||||
|
...
|
||||||
|
|
||||||
|
# Test: Lists
|
||||||
|
|
||||||
|
## Ordered list with number and period
|
||||||
|
|
||||||
|
2. two
|
||||||
|
3. three
|
||||||
|
4. four
|
||||||
|
|
||||||
|
## Ordered list with number and bracket
|
||||||
|
|
||||||
|
8) eight
|
||||||
|
9) nine
|
||||||
|
10) ten
|
||||||
|
|
||||||
|
## Ordered list with roman numerals
|
||||||
|
|
||||||
|
II. one
|
||||||
|
III. two
|
||||||
|
IV. three
|
||||||
|
|
||||||
|
## Ordered nested list
|
||||||
|
|
||||||
|
1. one
|
||||||
|
1) orange
|
||||||
|
2) apple
|
||||||
|
* pine
|
||||||
|
* maple
|
||||||
|
3) orange
|
||||||
|
2. two
|
||||||
|
1. sunny
|
||||||
|
II. two
|
||||||
|
III. three
|
||||||
|
IV. four
|
||||||
|
2. rainy
|
BIN
tests/list-ordered/document.pdf
Normal file
BIN
tests/list-ordered/preview.png
Normal file
After Width: | Height: | Size: 65 KiB |
1
tests/list-task/build.sh
Normal file
@ -0,0 +1 @@
|
|||||||
|
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
34
tests/list-task/document.md
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
title: "Test: Task List"
|
||||||
|
author: [Author]
|
||||||
|
date: "2022-11-24"
|
||||||
|
subject: "Markdown"
|
||||||
|
keywords: [Markdown, Example, Text, List, Task List]
|
||||||
|
lang: "en"
|
||||||
|
...
|
||||||
|
|
||||||
|
# Test: Task List
|
||||||
|
|
||||||
|
## Task list unchecked
|
||||||
|
|
||||||
|
- [ ] one
|
||||||
|
- [ ] two
|
||||||
|
- [ ] three
|
||||||
|
|
||||||
|
## Task list checked
|
||||||
|
|
||||||
|
- [x] one
|
||||||
|
- [x] two
|
||||||
|
- [x] three
|
||||||
|
|
||||||
|
## Task list nested
|
||||||
|
|
||||||
|
- [x] one
|
||||||
|
- [ ] orange
|
||||||
|
- [ ] apple
|
||||||
|
- [x] pine
|
||||||
|
- [x] maple
|
||||||
|
- [ ] mango
|
||||||
|
- [ ] two
|
||||||
|
- [x] sunny
|
||||||
|
- [ ] rainy
|
BIN
tests/list-task/document.pdf
Normal file
BIN
tests/list-task/preview.png
Normal file
After Width: | Height: | Size: 48 KiB |
1
tests/list-unordered/build.sh
Normal file
@ -0,0 +1 @@
|
|||||||
|
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
43
tests/list-unordered/document.md
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
title: "List Unordered"
|
||||||
|
author: [Author]
|
||||||
|
date: "2022-11-24"
|
||||||
|
subject: "Markdown"
|
||||||
|
keywords: [Markdown, Example, Text, List, Unordered List]
|
||||||
|
lang: "en"
|
||||||
|
...
|
||||||
|
|
||||||
|
# Test: List Unordered
|
||||||
|
|
||||||
|
## Unordered list with dash
|
||||||
|
|
||||||
|
- one
|
||||||
|
- two
|
||||||
|
- three
|
||||||
|
|
||||||
|
## Unordered list with asterisk
|
||||||
|
|
||||||
|
* one
|
||||||
|
* two
|
||||||
|
* three
|
||||||
|
|
||||||
|
## Unordered list with plus sign
|
||||||
|
|
||||||
|
+ one
|
||||||
|
+ two
|
||||||
|
+ three
|
||||||
|
|
||||||
|
## Unordered nested list
|
||||||
|
|
||||||
|
- one
|
||||||
|
- orange
|
||||||
|
- apple
|
||||||
|
* pine
|
||||||
|
* maple
|
||||||
|
- orange
|
||||||
|
- two
|
||||||
|
+ sunny
|
||||||
|
* four
|
||||||
|
* five
|
||||||
|
* six
|
||||||
|
+ rainy
|
BIN
tests/list-unordered/document.pdf
Normal file
BIN
tests/list-unordered/preview.png
Normal file
After Width: | Height: | Size: 60 KiB |