Skip to content

Commit 146b960

Browse files
authored
Add SlimerJS instructions
1 parent ab8b409 commit 146b960

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

docs/site/pdf_generation.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ are distributed paper versions of the problems.
44

55
For example, [here](https://dmoj.ca/problem/ioi14p1/pdf) is a generated PDF of [this problem](https://dmoj.ca/problem/ioi14p1).
66

7-
## Installing PhantomJS
7+
You can either use PhantomJS or SlimerJS to render PDFs.
8+
9+
## PhantomJS
10+
811
Grab a PhantomJS build from [the download page](http://phantomjs.org/download.html), and extract it. For these static
912
builds, there is no need to do anything further. You can run it to verify it's working.
1013

@@ -13,7 +16,7 @@ $ phantomjs --version
1316
2.1.1
1417
```
1518

16-
## Configuring DMOJ to use PhantomJS
19+
### Configuring DMOJ to use PhantomJS
1720
Configuring DMOJ to generate PDFs with PhantomJS requires the addition of a couple of lines to your `local_settings.py`.
1821

1922
```py
@@ -26,6 +29,22 @@ PHANTOMJS = '/usr/local/bin/phantomjs'
2629

2730
Restart DMOJ for the changes to take effect.
2831

32+
## SlimerJS
33+
34+
Grab a SlimerJS build from [here](https://github.com/DMOJ/site/files/2613909/slimerjs-1.0.0-firefox60.zip) and install Firefox 60 ESR.
35+
36+
### Configuration
37+
38+
```py
39+
# Cache location for generated PDFs. You should consider using something more persistant
40+
# than /tmp, since PDF generation is an expensive operation.
41+
PROBLEM_PDF_CACHE = '/tmp'
42+
# Path to wherever you extracted the SlimerJS binary.
43+
SLIMERJS = '/usr/local/bin/slimerjs'
44+
# Path to Firefox, if you installed it at a non-standard location:
45+
SLIMERJS_FIREFOX_PATH = '/usr/bin/firefox'
46+
```
47+
2948
!!! note
3049
The DMOJ uses a Segoe UI font when viewed on Windows browsers. If running PhantomJS on a Linux server, installing
3150
Segoe UI fonts on it will provide optimal rendering quality — otherwise, a fallback font will be used and

0 commit comments

Comments
 (0)