Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Pandoc export to JATS XML #51

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions build/assets/pandoc-jats
Submodule pandoc-jats added at d3aaa4
17 changes: 17 additions & 0 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion output/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ This directory contains the following files:
+ [`references.json`](references.json) is CSL-JSON file of bibliographic item metadata ([see specification](https://github.com/citation-style-language/schema/blob/master/csl-data.json)) for all references.
+ [`variables.json`](variables.json) contains variables that were passed to the jinja2 templater. These variables contain those automatically generated by the manubot as well as those provided by the user via the `--template-variables-path` option.

Pandoc consumes `manuscript.md` and `references.json` to create the formatted manuscript, which is exported to `manuscript.html`, `manuscript.pdf`, and optionally `manuscript.docx`.
Pandoc consumes `manuscript.md` and `references.json` to create the formatted manuscript, which is exported to `manuscript.html`, `manuscript.pdf`, `manuscript.xml`, and optionally `manuscript.docx`.