-
Notifications
You must be signed in to change notification settings - Fork 224
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
CI: Build PDF documentation using tectonic #3765
base: main
Are you sure you want to change the base?
Changes from 5 commits
050ab21
755505c
077bfb2
e7d81e7
cf0006e
e6270ef
225d46e
54406c0
e780d43
c85c571
510b269
8d1b14a
535da8f
32011fe
06d668f
ec305d0
93a9ac3
5a7390d
c844c5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,6 +117,8 @@ jobs: | |
sphinx-design | ||
sphinx-gallery | ||
sphinx_rtd_theme<3.0 | ||
imagemagick | ||
tectonic | ||
|
||
# Download cached remote files (artifacts) from GitHub | ||
- name: Download remote data from GitHub | ||
|
@@ -137,7 +139,20 @@ jobs: | |
|
||
# Build the documentation | ||
- name: Build the documentation | ||
run: make -C doc clean all | ||
run: make -C doc clean html | ||
|
||
- name: Build the PDF | ||
run: | | ||
make -C doc pdf | ||
ls -lh doc/_build/latex/* | ||
|
||
# Temporarily upload the built PDF to the artifacts | ||
- name: Upload PDF to artifacts | ||
uses: actions/[email protected] | ||
with: | ||
name: pygmt-docs-pdf | ||
path: doc/_build/latex/pygmt.pdf | ||
if: matrix.os == 'ubuntu-latest' | ||
seisman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Checkout the gh-pages branch | ||
uses: actions/[email protected] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,12 +28,13 @@ | |
"sphinx.ext.autodoc", | ||
"sphinx.ext.autosummary", | ||
"sphinx.ext.coverage", | ||
"sphinx.ext.mathjax", | ||
"sphinx.ext.doctest", | ||
"sphinx.ext.viewcode", | ||
"sphinx.ext.extlinks", | ||
"sphinx.ext.imgconverter", | ||
"sphinx.ext.intersphinx", | ||
"sphinx.ext.mathjax", | ||
"sphinx.ext.napoleon", | ||
"sphinx.ext.viewcode", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sort all extensions alphabetically. |
||
"sphinx_autodoc_typehints", | ||
"sphinx_copybutton", | ||
"sphinx_design", | ||
|
@@ -248,3 +249,6 @@ | |
"github_version": "main", | ||
"commit": commit_link, | ||
} | ||
|
||
# Configurations for LaTeX | ||
latex_engine = "xelatex" | ||
Comment on lines
+253
to
+254
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default latex engine is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The badges in the documentation are SVG files, and LaTeX doesn't support SVG with errors like:
The issue can be fixed by enabling the
sphinx.ext.imgconverter
extension, which requires ImageMagick.As explained in https://www.sphinx-doc.org/en/master/usage/extensions/imgconverter.html:
Here is a comparison for different ways to support SVG in PDFs. From the CI runs, we can know the number of packages, and their sizes for each case:
It seems "sphinxcontrib-svg2pdfconverter + CairoSVG" is the preferred option.