diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6993dd9e..8070d648 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 sphinx-autodoc2 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 8643d463..35ab12c7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,10 +17,6 @@ import os import sys -sys.path.insert(0, os.path.abspath("..")) - -import symengine - # -- Project information ----------------------------------------------------- project = 'symengine' @@ -28,7 +24,7 @@ author = 'SymEngine development team ' # The full version, including alpha/beta/rc tags -release = symengine.__version__ +# release = symengine.__version__ # -- General configuration --------------------------------------------------- @@ -46,9 +42,13 @@ "sphinx.ext.duration", # Shows times in the processing pipeline "sphinx.ext.mathjax", # Need math support "sphinx.ext.githubpages", # Puts the .nojekyll and CNAME files - "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. @@ -87,4 +87,4 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +# html_static_path = ['_static'] 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