From 2066ebd8e150b64ddd2637c3361029b7407e36ee Mon Sep 17 00:00:00 2001 From: Colin Marquardt Date: Wed, 3 Jan 2024 11:11:03 +0100 Subject: [PATCH] Fix RTD rendering of inheritance diagram; show API docs (#120) --- .gitignore | 2 +- .readthedocs.yml | 2 ++ docs/Makefile | 2 +- docs/api/inheritance_diagram.rst | 5 ----- docs/conf.py | 6 +++++- docs/index.rst | 18 +++++++++--------- docs/inheritance_diagram.rst | 6 ++++++ 7 files changed, 24 insertions(+), 17 deletions(-) delete mode 100644 docs/api/inheritance_diagram.rst create mode 100644 docs/inheritance_diagram.rst diff --git a/.gitignore b/.gitignore index 4b56807..5c88112 100644 --- a/.gitignore +++ b/.gitignore @@ -52,7 +52,7 @@ coverage.xml # Sphinx documentation docs/_build/ -docs/api +docs/api_generated/ # PyBuilder target/ diff --git a/.readthedocs.yml b/.readthedocs.yml index bd3bae5..a96ff6f 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -7,6 +7,8 @@ build: os: ubuntu-22.04 tools: python: "3.11" + apt_packages: + - graphviz python: install: diff --git a/docs/Makefile b/docs/Makefile index b61b876..88c2b43 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -17,5 +17,5 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXAPIDOC) -f -o api/ -H "API" -e ../junitparser + @$(SPHINXAPIDOC) -f -o api_generated/ -H "API" -e ../junitparser @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/api/inheritance_diagram.rst b/docs/api/inheritance_diagram.rst deleted file mode 100644 index 1fcd88c..0000000 --- a/docs/api/inheritance_diagram.rst +++ /dev/null @@ -1,5 +0,0 @@ -Class Inheritance -================= - -.. inheritance-diagram:: junitparser.junitparser - :parts: 5 diff --git a/docs/conf.py b/docs/conf.py index 37df7c3..27654cc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ # -- Project information ----------------------------------------------------- project = "junitparser" -copyright = "2019-2023, Joel Wang" +copyright = "2019-2024, Joel Wang" author = "Joel Wang" # The short X.Y version @@ -184,3 +184,7 @@ # -- Extension configuration ------------------------------------------------- + +# -- Extra setup for inheritance_diagram directive which uses graphviz --------- + +graphviz_output_format = "svg" diff --git a/docs/index.rst b/docs/index.rst index b79a102..742edd1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,15 +1,15 @@ .. include:: ../README.rst +.. + NOTE: the "index" self-reference in the toctree below produces a warning + but makes sure it shows up in the left-side TOC like all the other pages + .. toctree:: :maxdepth: 2 :hidden: - api/inheritance_diagram - api/modules - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` + index + api + genindex + modindex + search diff --git a/docs/inheritance_diagram.rst b/docs/inheritance_diagram.rst new file mode 100644 index 0000000..92c7f5b --- /dev/null +++ b/docs/inheritance_diagram.rst @@ -0,0 +1,6 @@ +************************* +Class Inheritance Diagram +************************* + +.. inheritance-diagram:: junitparser.junitparser + :parts: -1