diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..f701990 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,52 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Generate and deploy documentation + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main", "master", "add-automated-documentation"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: write + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install dependencies + run: | + pip install sphinx furo myst-parser + - name: Sphinx APIDoc + run: | + sphinx-apidoc -f -o docs/source/ . + - name: Sphinx build + run: | + sphinx-build -b html docs/source/ docs/build/html + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: './docs/build/html' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..dc1312a --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..52d5608 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,41 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information +import os +import sys + +# Add the parent directory of the documentation root to sys.path +sys.path.insert(0, os.path.abspath("../..")) + +project = 'tika-python' +copyright = '2024, Chris A. Mattmann' +author = 'Chris A. Mattmann' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.viewcode", + "sphinx.ext.napoleon", + "sphinx.ext.doctest", + "sphinx.ext.autosectionlabel", + "sphinx.ext.todo", + "sphinx.ext.duration", + "myst_parser" +] + +templates_path = ['_templates'] +exclude_patterns = ['tika.tests*'] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'furo' +html_static_path = ['_static'] diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..dfc67b6 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,21 @@ +.. tika-python documentation master file, created by + sphinx-quickstart on Sun Apr 14 20:07:31 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to tika-python's documentation! +======================================= + +.. toctree:: + :maxdepth: 7 + :caption: Contents: + + readme + tika + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/source/modules.rst b/docs/source/modules.rst new file mode 100644 index 0000000..ed38b54 --- /dev/null +++ b/docs/source/modules.rst @@ -0,0 +1,8 @@ +tika-python +=========== + +.. toctree:: + :maxdepth: 4 + + setup + tika diff --git a/docs/source/readme.rst b/docs/source/readme.rst new file mode 100644 index 0000000..13e1746 --- /dev/null +++ b/docs/source/readme.rst @@ -0,0 +1,5 @@ +README.md +========== + +.. include:: ../../README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/source/setup.rst b/docs/source/setup.rst new file mode 100644 index 0000000..552eb49 --- /dev/null +++ b/docs/source/setup.rst @@ -0,0 +1,7 @@ +setup module +============ + +.. automodule:: setup + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/tika.rst b/docs/source/tika.rst new file mode 100644 index 0000000..9c0d903 --- /dev/null +++ b/docs/source/tika.rst @@ -0,0 +1,77 @@ +tika package +============ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + tika.tests + +Submodules +---------- + +tika.config module +------------------ + +.. automodule:: tika.config + :members: + :undoc-members: + :show-inheritance: + +tika.detector module +-------------------- + +.. automodule:: tika.detector + :members: + :undoc-members: + :show-inheritance: + +tika.language module +-------------------- + +.. automodule:: tika.language + :members: + :undoc-members: + :show-inheritance: + +tika.parser module +------------------ + +.. automodule:: tika.parser + :members: + :undoc-members: + :show-inheritance: + +tika.tika module +---------------- + +.. automodule:: tika.tika + :members: + :undoc-members: + :show-inheritance: + +tika.translate module +--------------------- + +.. automodule:: tika.translate + :members: + :undoc-members: + :show-inheritance: + +tika.unpack module +------------------ + +.. automodule:: tika.unpack + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: tika + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/tika.tests.rst b/docs/source/tika.tests.rst new file mode 100644 index 0000000..70f525c --- /dev/null +++ b/docs/source/tika.tests.rst @@ -0,0 +1,77 @@ +tika.tests package +================== + +Submodules +---------- + +tika.tests.memory\_benchmark module +----------------------------------- + +.. automodule:: tika.tests.memory_benchmark + :members: + :undoc-members: + :show-inheritance: + +tika.tests.test\_benchmark module +--------------------------------- + +.. automodule:: tika.tests.test_benchmark + :members: + :undoc-members: + :show-inheritance: + +tika.tests.test\_from\_file\_service module +------------------------------------------- + +.. automodule:: tika.tests.test_from_file_service + :members: + :undoc-members: + :show-inheritance: + +tika.tests.test\_ssl\_link module +--------------------------------- + +.. automodule:: tika.tests.test_ssl_link + :members: + :undoc-members: + :show-inheritance: + +tika.tests.test\_tika module +---------------------------- + +.. automodule:: tika.tests.test_tika + :members: + :undoc-members: + :show-inheritance: + +tika.tests.tests\_params module +------------------------------- + +.. automodule:: tika.tests.tests_params + :members: + :undoc-members: + :show-inheritance: + +tika.tests.tests\_unpack module +------------------------------- + +.. automodule:: tika.tests.tests_unpack + :members: + :undoc-members: + :show-inheritance: + +tika.tests.utils module +----------------------- + +.. automodule:: tika.tests.utils + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: tika.tests + :members: + :undoc-members: + :show-inheritance: