You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+59Lines changed: 59 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -191,4 +191,63 @@ Then in your `.md` documents include a code block as in reStructuredTexts::
191
191
Alice->John: Hello John, how are you?
192
192
```
193
193
194
+
Building PDFs on readthedocs.io
195
+
-----------------------------------
196
+
197
+
In order to have Mermaid diagrams build properly in PDFs generated on readthedocs.io, you will need a few extra configurations.
198
+
199
+
1. In your ``.readthedocs.yaml`` file (which should be in the root of your repository) include a ``post-install`` command to install the Mermaid CLI: ::
200
+
201
+
build:
202
+
os: ubuntu-20.04
203
+
tools:
204
+
python: "3.8"
205
+
nodejs: "16"
206
+
jobs:
207
+
post_install:
208
+
- npm install -g @mermaid-js/mermaid-cli
209
+
210
+
Note that if you previously did not have a ``.readthedocs.yaml`` file, you will also need to specify all targets you wish to build and other basic configuration options. A minimal example of a complete file is: ::
211
+
212
+
# .readthedocs.yaml
213
+
# Read the Docs configuration file
214
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
215
+
216
+
# Required
217
+
version: 2
218
+
219
+
# Set the version of Python and other tools you might need
220
+
build:
221
+
os: ubuntu-20.04
222
+
tools:
223
+
python: "3.8"
224
+
nodejs: "16"
225
+
jobs:
226
+
post_install:
227
+
- npm install -g @mermaid-js/mermaid-cli
228
+
229
+
# Build documentation in the docs/ directory with Sphinx
230
+
sphinx:
231
+
configuration: docs/conf.py
232
+
233
+
# If using Sphinx, optionally build your docs in additional formats such as PDF
234
+
formats:
235
+
- epub
236
+
- pdf
237
+
238
+
python:
239
+
install:
240
+
- requirements: docs/requirements.txt
241
+
242
+
2. In your documentation directory add file ``puppeteer-config.json`` with contents: ::
243
+
244
+
{
245
+
"args": ["--no-sandbox"]
246
+
}
247
+
248
+
249
+
3. In your documentation ``conf.py`` file, add: ::
0 commit comments