diff --git a/.gitignore b/.gitignore index 6065098..4292209 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ private/ # build folder dist/ +.idea + # contains unit tests (incomplete at the moment, so don't include them) test/ test/.idea/ diff --git a/examples/basic-example/document.pdf b/examples/basic-example/document.pdf index 1a45f51..19a5d14 100644 Binary files a/examples/basic-example/document.pdf and b/examples/basic-example/document.pdf differ diff --git a/examples/beamer/document.pdf b/examples/beamer/document.pdf index 8befc6c..164e286 100644 Binary files a/examples/beamer/document.pdf and b/examples/beamer/document.pdf differ diff --git a/examples/book/document.pdf b/examples/book/document.pdf index 069afc5..7985b3a 100644 Binary files a/examples/book/document.pdf and b/examples/book/document.pdf differ diff --git a/examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.pdf b/examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.pdf index 60e94c7..01f8a11 100644 Binary files a/examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.pdf and b/examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.pdf differ diff --git a/examples/boxes-with-pandoc-latex-environment-and-tcolorbox/document.pdf b/examples/boxes-with-pandoc-latex-environment-and-tcolorbox/document.pdf index 6f37a4a..b014101 100644 Binary files a/examples/boxes-with-pandoc-latex-environment-and-tcolorbox/document.pdf and b/examples/boxes-with-pandoc-latex-environment-and-tcolorbox/document.pdf differ diff --git a/examples/build-examples.sh b/examples/build-examples.sh index 6812066..e880f55 100644 --- a/examples/build-examples.sh +++ b/examples/build-examples.sh @@ -14,7 +14,7 @@ containsElement () { } # 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 for f in *; do diff --git a/examples/code-blocks-listings/document.pdf b/examples/code-blocks-listings/document.pdf index c840d56..a4dae50 100644 Binary files a/examples/code-blocks-listings/document.pdf and b/examples/code-blocks-listings/document.pdf differ diff --git a/examples/code-blocks-without-listings/document.pdf b/examples/code-blocks-without-listings/document.pdf index 3f795b4..8d38289 100644 Binary files a/examples/code-blocks-without-listings/document.pdf and b/examples/code-blocks-without-listings/document.pdf differ diff --git a/examples/code-blocks-without-listings/preview.png b/examples/code-blocks-without-listings/preview.png index 265818d..110cd75 100644 Binary files a/examples/code-blocks-without-listings/preview.png and b/examples/code-blocks-without-listings/preview.png differ diff --git a/examples/header-and-footer/document.pdf b/examples/header-and-footer/document.pdf index 431d04f..1bb914c 100644 Binary files a/examples/header-and-footer/document.pdf and b/examples/header-and-footer/document.pdf differ diff --git a/examples/images-and-tables/document.pdf b/examples/images-and-tables/document.pdf index 7f31879..ae2fe4d 100644 Binary files a/examples/images-and-tables/document.pdf and b/examples/images-and-tables/document.pdf differ diff --git a/examples/images-and-tables/preview.png b/examples/images-and-tables/preview.png index ae53e49..387a52b 100644 Binary files a/examples/images-and-tables/preview.png and b/examples/images-and-tables/preview.png differ diff --git a/examples/language-german/document.pdf b/examples/language-german/document.pdf index 5cad3db..009030a 100644 Binary files a/examples/language-german/document.pdf and b/examples/language-german/document.pdf differ diff --git a/examples/language-japanese/document.pdf b/examples/language-japanese/document.pdf index 06e5d67..1a9853f 100644 Binary files a/examples/language-japanese/document.pdf and b/examples/language-japanese/document.pdf differ diff --git a/examples/page-background/document.pdf b/examples/page-background/document.pdf index 7b7cb16..587ed14 100644 Binary files a/examples/page-background/document.pdf and b/examples/page-background/document.pdf differ diff --git a/examples/table-of-contents/document.pdf b/examples/table-of-contents/document.pdf index 1f58d12..8ff3cea 100644 Binary files a/examples/table-of-contents/document.pdf and b/examples/table-of-contents/document.pdf differ diff --git a/examples/table-of-contents/preview.png b/examples/table-of-contents/preview.png index 62e2aec..80a0dbf 100644 Binary files a/examples/table-of-contents/preview.png and b/examples/table-of-contents/preview.png differ diff --git a/examples/title-page-background/document.pdf b/examples/title-page-background/document.pdf index 4bfb211..ba741f3 100644 Binary files a/examples/title-page-background/document.pdf and b/examples/title-page-background/document.pdf differ diff --git a/examples/title-page-custom/document.pdf b/examples/title-page-custom/document.pdf index 0b6c0e9..9e54c89 100644 Binary files a/examples/title-page-custom/document.pdf and b/examples/title-page-custom/document.pdf differ diff --git a/examples/title-page-default/document.pdf b/examples/title-page-default/document.pdf index b4a749c..df6b506 100644 Binary files a/examples/title-page-default/document.pdf and b/examples/title-page-default/document.pdf differ diff --git a/examples/title-page-green/document.pdf b/examples/title-page-green/document.pdf index 398bbce..1634591 100644 Binary files a/examples/title-page-green/document.pdf and b/examples/title-page-green/document.pdf differ diff --git a/examples/title-page-logo/document.pdf b/examples/title-page-logo/document.pdf index 146c19f..15a2794 100644 Binary files a/examples/title-page-logo/document.pdf and b/examples/title-page-logo/document.pdf differ diff --git a/tests/build-tests.sh b/tests/build-tests.sh new file mode 100644 index 0000000..686e4a6 --- /dev/null +++ b/tests/build-tests.sh @@ -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 \ No newline at end of file diff --git a/tests/heading/build.sh b/tests/heading/build.sh new file mode 100644 index 0000000..ee87a78 --- /dev/null +++ b/tests/heading/build.sh @@ -0,0 +1 @@ +pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings \ No newline at end of file diff --git a/tests/heading/document.md b/tests/heading/document.md new file mode 100644 index 0000000..60ef278 --- /dev/null +++ b/tests/heading/document.md @@ -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 diff --git a/tests/heading/document.pdf b/tests/heading/document.pdf new file mode 100644 index 0000000..a5a1a47 Binary files /dev/null and b/tests/heading/document.pdf differ diff --git a/tests/heading/preview.png b/tests/heading/preview.png new file mode 100644 index 0000000..babbbbc Binary files /dev/null and b/tests/heading/preview.png differ diff --git a/tests/horizontal-rule/build.sh b/tests/horizontal-rule/build.sh new file mode 100644 index 0000000..ee87a78 --- /dev/null +++ b/tests/horizontal-rule/build.sh @@ -0,0 +1 @@ +pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings \ No newline at end of file diff --git a/tests/horizontal-rule/document.md b/tests/horizontal-rule/document.md new file mode 100644 index 0000000..f6a9444 --- /dev/null +++ b/tests/horizontal-rule/document.md @@ -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) + +____ + +__________ diff --git a/tests/horizontal-rule/document.pdf b/tests/horizontal-rule/document.pdf new file mode 100644 index 0000000..37acbb1 Binary files /dev/null and b/tests/horizontal-rule/document.pdf differ diff --git a/tests/horizontal-rule/preview.png b/tests/horizontal-rule/preview.png new file mode 100644 index 0000000..561da89 Binary files /dev/null and b/tests/horizontal-rule/preview.png differ diff --git a/tests/list-definition/build.sh b/tests/list-definition/build.sh new file mode 100644 index 0000000..ee87a78 --- /dev/null +++ b/tests/list-definition/build.sh @@ -0,0 +1 @@ +pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings \ No newline at end of file diff --git a/tests/list-definition/document.md b/tests/list-definition/document.md new file mode 100644 index 0000000..b13d021 --- /dev/null +++ b/tests/list-definition/document.md @@ -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. diff --git a/tests/list-definition/document.pdf b/tests/list-definition/document.pdf new file mode 100644 index 0000000..1f55333 Binary files /dev/null and b/tests/list-definition/document.pdf differ diff --git a/tests/list-definition/preview.png b/tests/list-definition/preview.png new file mode 100644 index 0000000..d466e63 Binary files /dev/null and b/tests/list-definition/preview.png differ diff --git a/tests/list-ordered/build.sh b/tests/list-ordered/build.sh new file mode 100644 index 0000000..ee87a78 --- /dev/null +++ b/tests/list-ordered/build.sh @@ -0,0 +1 @@ +pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings \ No newline at end of file diff --git a/tests/list-ordered/document.md b/tests/list-ordered/document.md new file mode 100644 index 0000000..0a60ef6 --- /dev/null +++ b/tests/list-ordered/document.md @@ -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 diff --git a/tests/list-ordered/document.pdf b/tests/list-ordered/document.pdf new file mode 100644 index 0000000..9025551 Binary files /dev/null and b/tests/list-ordered/document.pdf differ diff --git a/tests/list-ordered/preview.png b/tests/list-ordered/preview.png new file mode 100644 index 0000000..e796602 Binary files /dev/null and b/tests/list-ordered/preview.png differ diff --git a/tests/list-task/build.sh b/tests/list-task/build.sh new file mode 100644 index 0000000..ee87a78 --- /dev/null +++ b/tests/list-task/build.sh @@ -0,0 +1 @@ +pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings \ No newline at end of file diff --git a/tests/list-task/document.md b/tests/list-task/document.md new file mode 100644 index 0000000..e6b5128 --- /dev/null +++ b/tests/list-task/document.md @@ -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 diff --git a/tests/list-task/document.pdf b/tests/list-task/document.pdf new file mode 100644 index 0000000..b3a3d4e Binary files /dev/null and b/tests/list-task/document.pdf differ diff --git a/tests/list-task/preview.png b/tests/list-task/preview.png new file mode 100644 index 0000000..0d3be0a Binary files /dev/null and b/tests/list-task/preview.png differ diff --git a/tests/list-unordered/build.sh b/tests/list-unordered/build.sh new file mode 100644 index 0000000..ee87a78 --- /dev/null +++ b/tests/list-unordered/build.sh @@ -0,0 +1 @@ +pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings \ No newline at end of file diff --git a/tests/list-unordered/document.md b/tests/list-unordered/document.md new file mode 100644 index 0000000..fdd36a1 --- /dev/null +++ b/tests/list-unordered/document.md @@ -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 diff --git a/tests/list-unordered/document.pdf b/tests/list-unordered/document.pdf new file mode 100644 index 0000000..9ac01d6 Binary files /dev/null and b/tests/list-unordered/document.pdf differ diff --git a/tests/list-unordered/preview.png b/tests/list-unordered/preview.png new file mode 100644 index 0000000..a7f7b94 Binary files /dev/null and b/tests/list-unordered/preview.png differ