File tree Expand file tree Collapse file tree 5 files changed +30
-5
lines changed Expand file tree Collapse file tree 5 files changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,9 @@ jobs:
117117 sphinx-design
118118 sphinx-gallery
119119 sphinx_rtd_theme<3.0
120+ cairosvg
121+ sphinxcontrib-svg2pdfconverter
122+ tectonic
120123
121124 # Download cached remote files (artifacts) from GitHub
122125 - name : Download remote data from GitHub
@@ -135,9 +138,11 @@ jobs:
135138 python -m build --sdist
136139 python -m pip install dist/*
137140
138- # Build the documentation
139- - name : Build the documentation
140- run : make -C doc clean all
141+ - name : Build the HTML documentation
142+ run : make -C doc clean html
143+
144+ - name : Build the PDF documentation
145+ run : make -C doc pdf
141146
142147 - name : Checkout the gh-pages branch
143148
Original file line number Diff line number Diff line change @@ -32,3 +32,6 @@ dependencies:
3232 - sphinx-design
3333 - sphinx-gallery
3434 - sphinx_rtd_theme<3.0
35+ # Dev dependencies (building PDF documentation)
36+ # 'sphinxcontrib-svg2pdfconverter' is required since it's added to `extensions`.
37+ - sphinxcontrib-svg2pdfconverter
Original file line number Diff line number Diff line change 1515 @echo " api generate rst source files of API documentation"
1616 @echo " html build the HTML files from the existing rst sources"
1717 @echo " html-noplot build the HTML files without running any examples"
18+ @echo " pdf build the PDF documentation"
1819 @echo " server make a local HTTP server for previewing the built documentation"
1920 @echo " clean clean up built and generated files"
2021
@@ -43,6 +44,14 @@ html-noplot: api
4344 @echo
4445 @echo " Build finished. The HTML pages are in $( BUILDDIR) /html."
4546
47+ pdf : latex
48+ @echo
49+ @echo " Building PDF via Tectonic."
50+ @echo
51+ tectonic -X compile $(BUILDDIR ) /latex/pygmt.tex
52+ @echo
53+ @echo " PDF build finished. The PDF file is in $( BUILDDIR) /latex/pygmt.pdf."
54+
4655server :
4756 @echo
4857 @echo " Running a server on port 8009."
Original file line number Diff line number Diff line change 2828 "sphinx.ext.autodoc" ,
2929 "sphinx.ext.autosummary" ,
3030 "sphinx.ext.coverage" ,
31- "sphinx.ext.mathjax" ,
3231 "sphinx.ext.doctest" ,
33- "sphinx.ext.viewcode" ,
3432 "sphinx.ext.extlinks" ,
3533 "sphinx.ext.intersphinx" ,
34+ "sphinx.ext.mathjax" ,
3635 "sphinx.ext.napoleon" ,
36+ "sphinx.ext.viewcode" ,
3737 "sphinx_autodoc_typehints" ,
3838 "sphinx_copybutton" ,
3939 "sphinx_design" ,
4040 "sphinx_gallery.gen_gallery" ,
41+ "sphinxcontrib.cairosvgconverter" ,
4142]
4243
4344# Suppress warnings
248249 "github_version" : "main" ,
249250 "commit" : commit_link ,
250251}
252+
253+ # Configurations for LaTeX
254+ latex_engine = "xelatex"
Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ dependencies:
4444 - sphinx-design
4545 - sphinx-gallery>=0.17.0
4646 - sphinx_rtd_theme<3.0
47+ # Dev dependencies (building PDF documentation)
48+ - cairosvg
49+ - sphinxcontrib-svg2pdfconverter
50+ - tectonic
4751 # Dev dependencies (type hints)
4852 - mypy
4953 - pandas-stubs
You can’t perform that action at this time.
0 commit comments