diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6993dd9e..ec4c0ba8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -151,6 +151,8 @@ jobs: shell: bash run: | source bin/test_symengine_unix.sh + pip install sphinx m2r2 sphinxcontrib-apidoc sphinx-book-theme + sphinx-build docs/ genDocs env: PYTEST_ADDOPTS: ${{ matrix.PYTEST_ADDOPTS }} USE_GLIBCXX_DEBUG: ${{ matrix.USE_GLIBCXX_DEBUG }} @@ -185,6 +187,12 @@ jobs: BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS }} PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }} + - name: Generate documentation + shell: bash + run: | + pip install sphinx m2r2 sphinx-autodoc2 sphinx-book-theme + sphinx-build docs/ genDocs + - name: Deploy Documentation if: ${{ (github.ref == 'refs/heads/main' && github.repository == 'Symengine/symengine.py') || (github.ref == 'refs/heads/master' && github.repository == 'Symengine/symengine.py')}} uses: peaceiris/actions-gh-pages@v3 diff --git a/bin/test_symengine_unix.sh b/bin/test_symengine_unix.sh index 976f305d..72e829f1 100644 --- a/bin/test_symengine_unix.sh +++ b/bin/test_symengine_unix.sh @@ -19,4 +19,3 @@ source bin/install_travis.sh # Build Python wrappers and test cd $PYTHON_SOURCE_DIR bin/test_travis.sh - diff --git a/docs/conf.py b/docs/conf.py index d897f479..717de3f5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -49,6 +49,11 @@ "sphinxcontrib.apidoc", # Automatically sets up sphinx-apidoc # "recommonmark", # Parses markdown "m2r2", # Parses markdown in rst + "autodoc2", +] + +autodoc2_packages = [ + "../symengine", ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/index.rst b/docs/index.rst index 9a47bd0a..63408ef3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,7 +10,7 @@ Symengine Python API Documentation :maxdepth: 2 :caption: Contents: - source/modules + apidocs/index .. mdinclude:: ../README.md