Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automated documentation #409

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -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)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -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
41 changes: 41 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -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']
21 changes: 21 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -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`
8 changes: 8 additions & 0 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tika-python
===========

.. toctree::
:maxdepth: 4

setup
tika
5 changes: 5 additions & 0 deletions docs/source/readme.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
README.md
==========

.. include:: ../../README.md
:parser: myst_parser.sphinx_
7 changes: 7 additions & 0 deletions docs/source/setup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
setup module
============

.. automodule:: setup
:members:
:undoc-members:
:show-inheritance:
77 changes: 77 additions & 0 deletions docs/source/tika.rst
Original file line number Diff line number Diff line change
@@ -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:
77 changes: 77 additions & 0 deletions docs/source/tika.tests.rst
Original file line number Diff line number Diff line change
@@ -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: