From c25b6a9d5c3a74723caf1dc757c4d9700910f697 Mon Sep 17 00:00:00 2001 From: Daniel Himmelstein Date: Thu, 10 Aug 2017 18:15:45 -0400 Subject: [PATCH] Pandoc: export to JATS XML --- .gitmodules | 3 +++ build/assets/pandoc-jats | 1 + build/build.sh | 17 +++++++++++++++++ 3 files changed, 21 insertions(+) create mode 160000 build/assets/pandoc-jats diff --git a/.gitmodules b/.gitmodules index 692574bf..b0b6071e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "ci/opentimestamps-client"] path = ci/opentimestamps-client url = https://github.com/opentimestamps/opentimestamps-client.git +[submodule "build/assets/pandoc-jats"] + path = build/assets/pandoc-jats + url = https://github.com/mfenner/pandoc-jats diff --git a/build/assets/pandoc-jats b/build/assets/pandoc-jats new file mode 160000 index 00000000..d3aaa439 --- /dev/null +++ b/build/assets/pandoc-jats @@ -0,0 +1 @@ +Subproject commit d3aaa4393125f5cf2d5b813b2fa2693afff70eb6 diff --git a/build/build.sh b/build/build.sh index 8f196f23..70039d8d 100644 --- a/build/build.sh +++ b/build/build.sh @@ -51,6 +51,23 @@ wkhtmltopdf \ webpage/index.html \ output/manuscript.pdf +# Create JATS XML output +# https://github.com/mfenner/pandoc-jats +echo "Exporting JATS XML manuscript" +pandoc --verbose \ + --smart \ + --from=markdown \ + --to=build/assets/pandoc-jats/JATS.lua \ + --filter pandoc-fignos \ + --filter pandoc-eqnos \ + --filter pandoc-tablenos \ + --template=build/assets/pandoc-jats/default.jats \ + --bibliography=$BIBLIOGRAPHY_PATH \ + --csl=$CSL_PATH \ + --metadata link-citations=true \ + --output=output/manuscript.xml \ + $INPUT_PATH + # Create DOCX output when user specifies to do so if [ "$BUILD_DOCX" = "true" ]; then