diff --git a/docs/Makefile b/docs/Makefile index 2f3c029db1..a93338df31 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -13,10 +13,6 @@ PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source -# SVG to PDF conversion -SVG2PDF = inkscape -PDFS = $(patsubst %.svg,%.pdf,$(wildcard $(IMAGEDIR)/*.svg)) - # Tikz to PNG conversion PNGS = $(patsubst %.tex,%.png,$(wildcard $(IMAGEDIR)/*.tex)) @@ -41,21 +37,13 @@ help: @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" -# Pattern rule for converting SVG to PDF -%.pdf: %.svg - $(SVG2PDF) -f $< -A $@ - %.png: %.tex pdflatex --interaction=nonstopmode --output-directory=$(IMAGEDIR) $< pdftoppm -r 120 -singlefile $(patsubst %.tex,%.pdf, $<) $(basename $<) convert -trim -fuzz 2% -transparent white $(patsubst %.tex,%.ppm,$<) $@ -# Rule to build PDFs -images: $(PDFS) $(PNGS) - clean: -rm -rf $(BUILDDIR)/* - -rm -rf $(PDFS) -rm -rf source/pythonapi/generated/ html: diff --git a/docs/source/conf.py b/docs/source/conf.py index 834c47a405..928755cf81 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -52,6 +52,7 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode', + 'sphinx.ext.imgconverter', 'sphinx_numfig', 'notebook_sphinxext'] @@ -253,5 +254,5 @@ intersphinx_mapping = { 'python': ('https://docs.python.org/3', None), 'numpy': ('https://docs.scipy.org/doc/numpy/', None), 'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None), - 'matplotlib': ('http://matplotlib.org/', None) + 'matplotlib': ('https://matplotlib.org/', None) } diff --git a/docs/source/devguide/docbuild.rst b/docs/source/devguide/docbuild.rst index be4607cc6d..5cbbb65bb8 100644 --- a/docs/source/devguide/docbuild.rst +++ b/docs/source/devguide/docbuild.rst @@ -5,15 +5,16 @@ Building Sphinx Documentation ============================= In order to build the documentation in the ``docs`` directory, you will need to -have the Sphinx_ third-party Python package. The easiest way to install Sphinx -is via pip: +have the `Sphinx `_ third-party Python +package. The easiest way to install Sphinx is via pip: .. code-block:: sh sudo pip install sphinx Additionally, you will also need a Sphinx extension for numbering figures. The -Numfig_ package can be installed directly with pip: +`Numfig `_ package can be installed +directly with pip: .. code-block:: sh @@ -24,7 +25,7 @@ Building Documentation as a Webpage ----------------------------------- To build the documentation as a webpage (what appears at -http://mit-crpg.github.io/openmc), simply go to the ``docs`` directory and run: +http://openmc.readthedocs.io), simply go to the ``docs`` directory and run: .. code-block:: sh @@ -35,20 +36,9 @@ Building Documentation as a PDF ------------------------------- To build PDF documentation, you will need to have a LaTeX distribution installed -on your computer as well as Inkscape_, which is used to convert .svg files to -.pdf files. Inkscape can be installed in a Debian-derivative with: - -.. code-block:: sh - - sudo apt install inkscape - -One the pre-requisites are installed, simply go to the ``docs`` directory and -run: +on your computer. Once you have a LaTeX distribution installed, simply go to the +``docs`` directory and run: .. code-block:: sh make latexpdf - -.. _Sphinx: http://sphinx-doc.org -.. _Numfig: https://pypi.python.org/pypi/sphinx_numfig -.. _Inkscape: https://inkscape.org diff --git a/docs/source/methods/geometry.rst b/docs/source/methods/geometry.rst index 36c252bb1f..4e90dd9922 100644 --- a/docs/source/methods/geometry.rst +++ b/docs/source/methods/geometry.rst @@ -47,7 +47,7 @@ dividing space into two half-spaces. .. _fig-halfspace: -.. figure:: ../_images/halfspace.* +.. figure:: ../_images/halfspace.svg :align: center :figclass: align-center @@ -63,7 +63,7 @@ defined as the intersection of an ellipse and two planes. .. _fig-union: -.. figure:: ../_images/union.* +.. figure:: ../_images/union.svg :align: center :figclass: align-center @@ -482,7 +482,7 @@ upper-right tiles, respectively. .. _fig-rect-lat: -.. figure:: ../_images/rect_lat.* +.. figure:: ../_images/rect_lat.svg :align: center :figclass: align-center :width: 400px @@ -521,7 +521,7 @@ right side. .. _fig-hex-lat: -.. figure:: ../_images/hex_lat.* +.. figure:: ../_images/hex_lat.svg :align: center :figclass: align-center :width: 400px