Skip to content

Commit ec186c2

Browse files
authored
Update environment and documentation (#81)
Pandoc upgraded to v2.0.0.1 Swap anaconda packages to conda-forge Update build.sh for pandoc 2.0 WeasyPrint was not renderring MathJax, so use --webtex to convert equations to SVGs for PDF output. See Kozea/WeasyPrint#59
1 parent 38effe8 commit ec186c2

File tree

4 files changed

+38
-28
lines changed

4 files changed

+38
-28
lines changed

USAGE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ For guidance on what CSL JSON should be like for different document types, refer
120120
## Manuscript metadata
121121

122122
[`content/metadata.yaml`](content/metadata.yaml) contains manuscript metadata that gets passed through to Pandoc, via a [`yaml_metadata_block`](http://pandoc.org/MANUAL.html#extension-yaml_metadata_block).
123-
`metadata.yaml` should contain the manuscript `title`, `authors` list, and `keywords`.
123+
`metadata.yaml` should contain the manuscript `title`, `authors` list, `keywords`, and language (`lang`).
124124
Additional metadata, such as `date`, will automatically be created by the Manubot.
125125
Manubot uses the [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) specified in [`build.sh`](build/build.sh) for setting the manuscript's date.
126126
For example, setting the `TZ` environment variable to `Etc/UTC` directs the Manubot to use Coordinated Universal Time.
@@ -147,7 +147,7 @@ If you experience any issues with the Manubot or would like to contribute to its
147147

148148
For additional examples, check out existing manuscripts that use the Manubot:
149149

150-
+ Satoshi Nakamoto's Bitcoin Whitepaper ([source](https://github.com/dhimmel/bitcoin-whitepaper/), [manuscript](https://dhimmel.github.io/bitcoin-whitepaper/))
150+
+ Satoshi Nakamoto's Bitcoin Whitepaper ([source](https://github.com/dhimmel/bitcoin-whitepaper/), [manuscript](https://dhimmel.github.io/bitcoin-whitepaper/), [commentary](https://steemit.com/manubot/@dhimmel/how-i-used-the-manubot-to-reproduce-the-bitcoin-whitepaper))
151151
+ The Sci-Hub Coverage Study ([source](https://github.com/greenelab/scihub-manuscript), [manuscript](https://greenelab.github.io/scihub-manuscript/))
152152
+ A Report for the Vagelos Scholars Program by Michael Zietz ([source](https://github.com/zietzm/Vagelos2017), [manuscript](https://zietzm.github.io/Vagelos2017/))
153153
+ The Deep Review ([source](https://github.com/greenelab/deep-review), [manuscript](https://greenelab.github.io/deep-review/))

build/build.sh

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ echo "Exporting HTML manuscript"
2828
pandoc --verbose \
2929
--from=markdown \
3030
--to=html5 \
31-
--filter pandoc-fignos \
32-
--filter pandoc-eqnos \
33-
--filter pandoc-tablenos \
31+
--filter=pandoc-fignos \
32+
--filter=pandoc-eqnos \
33+
--filter=pandoc-tablenos \
3434
--bibliography=$BIBLIOGRAPHY_PATH \
3535
--csl=$CSL_PATH \
3636
--metadata link-citations=true \
37-
--smart \
3837
--mathjax \
3938
--css=github-pandoc.css \
4039
--include-in-header=build/assets/analytics.js \
@@ -44,30 +43,41 @@ pandoc --verbose \
4443

4544
# Create PDF output
4645
echo "Exporting PDF manuscript"
47-
weasyprint \
48-
--verbose \
49-
--presentational-hints \
50-
webpage/index.html \
51-
output/manuscript.pdf
46+
ln --symbolic content/images images
47+
pandoc \
48+
--from=markdown \
49+
--to=html5 \
50+
--pdf-engine=weasyprint \
51+
--pdf-engine-opt=--presentational-hints \
52+
--filter=pandoc-fignos \
53+
--filter=pandoc-eqnos \
54+
--filter=pandoc-tablenos \
55+
--bibliography=$BIBLIOGRAPHY_PATH \
56+
--csl=$CSL_PATH \
57+
--metadata link-citations=true \
58+
--webtex=https://latex.codecogs.com/svg.latex? \
59+
--css=webpage/github-pandoc.css \
60+
--output=output/manuscript.pdf \
61+
$INPUT_PATH
62+
rm --recursive images
5263

5364
# Create DOCX output when user specifies to do so
5465
if [ "$BUILD_DOCX" = "true" ];
5566
then
5667
echo "Exporting Word Docx manuscript"
57-
ln --symbolic content/images images
5868
pandoc --verbose \
5969
--from=markdown \
6070
--to=docx \
61-
--filter pandoc-fignos \
62-
--filter pandoc-tablenos \
71+
--filter=pandoc-fignos \
72+
--filter=pandoc-eqnos \
73+
--filter=pandoc-tablenos \
6374
--bibliography=$BIBLIOGRAPHY_PATH \
6475
--csl=$CSL_PATH \
6576
--metadata link-citations=true \
66-
--reference-docx=$DOCX_PATH \
67-
--smart \
77+
--reference-doc=$DOCX_PATH \
78+
--resource-path=.:content \
6879
--output=output/manuscript.docx \
6980
$INPUT_PATH
70-
rm --recursive images
7181
fi
7282

7383
echo "Build complete"

build/environment.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
name: manubot
22
channels:
3-
- anaconda
43
- conda-forge
54
dependencies:
6-
- anaconda::jinja2=2.9.6
7-
- anaconda::pandas=0.20.3
8-
- anaconda::python=3.6.2
9-
- anaconda::pyyaml=3.12
10-
- anaconda::requests=2.14.2
115
- conda-forge::cairo=1.14.6
126
- conda-forge::cffi=1.10.0
13-
- conda-forge::pandoc=1.19.2
7+
- conda-forge::jinja2=2.9.6
8+
- conda-forge::pandas=0.21.0
9+
- conda-forge::pandoc=2.0.0.1
10+
- conda-forge::python=3.6.3
11+
- conda-forge::pyyaml=3.12
12+
- conda-forge::requests=2.18.4
1413
- conda-forge::watchdog=0.8.3
1514
- pip:
1615
- errorhandler==2.0.1
1716
- ghp-import==0.5.5
1817
- git+https://github.com/greenelab/manubot@367f0b5c8046e5ce2f1e5a0ef555ec29a4aefd59
1918
- opentimestamps-client==0.5.0
2019
- opentimestamps==0.1.0
21-
- pandoc-eqnos==0.16
22-
- pandoc-fignos==0.20
23-
- pandoc-tablenos==0.16
20+
- pandoc-eqnos==0.18.1
21+
- pandoc-fignos==0.21.1
22+
- pandoc-tablenos==0.17.1
2423
- pybase62==0.3.2
2524
- pysha3==1.0.2
2625
- python-bitcoinlib==0.8.0
2726
- requests-cache==0.4.13
28-
- weasyprint==0.40
27+
- weasyprint==0.41

content/metadata.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ keywords:
44
- markdown
55
- publishing
66
- manubot
7+
lang: en-US
78
author_info:
89
-
910
github: johndoe

0 commit comments

Comments
 (0)