Skip to content

Commit 0bdf42b

Browse files
Merge pull request #409 from aleksandrskrivickis/add-automated-documentation
Add automated documentation
2 parents d28753d + eb370dc commit 0bdf42b

File tree

10 files changed

+343
-0
lines changed

10 files changed

+343
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Generate and deploy documentation
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["main", "master", "add-automated-documentation"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: write
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Single deploy job since we're just deploying
26+
deploy:
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Install dependencies
35+
run: |
36+
pip install sphinx furo myst-parser
37+
- name: Sphinx APIDoc
38+
run: |
39+
sphinx-apidoc -f -o docs/source/ .
40+
- name: Sphinx build
41+
run: |
42+
sphinx-build -b html docs/source/ docs/build/html
43+
- name: Setup Pages
44+
uses: actions/configure-pages@v5
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
# Upload entire repository
49+
path: './docs/build/html'
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/source/conf.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
import os
9+
import sys
10+
11+
# Add the parent directory of the documentation root to sys.path
12+
sys.path.insert(0, os.path.abspath("../.."))
13+
14+
project = 'tika-python'
15+
copyright = '2024, Chris A. Mattmann'
16+
author = 'Chris A. Mattmann'
17+
18+
# -- General configuration ---------------------------------------------------
19+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
20+
21+
extensions = [
22+
"sphinx.ext.autodoc",
23+
"sphinx.ext.viewcode",
24+
"sphinx.ext.napoleon",
25+
"sphinx.ext.doctest",
26+
"sphinx.ext.autosectionlabel",
27+
"sphinx.ext.todo",
28+
"sphinx.ext.duration",
29+
"myst_parser"
30+
]
31+
32+
templates_path = ['_templates']
33+
exclude_patterns = ['tika.tests*']
34+
35+
36+
37+
# -- Options for HTML output -------------------------------------------------
38+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
39+
40+
html_theme = 'furo'
41+
html_static_path = ['_static']

docs/source/index.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. tika-python documentation master file, created by
2+
sphinx-quickstart on Sun Apr 14 20:07:31 2024.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to tika-python's documentation!
7+
=======================================
8+
9+
.. toctree::
10+
:maxdepth: 7
11+
:caption: Contents:
12+
13+
readme
14+
tika
15+
16+
Indices and tables
17+
==================
18+
19+
* :ref:`genindex`
20+
* :ref:`modindex`
21+
* :ref:`search`

docs/source/modules.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
tika-python
2+
===========
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
setup
8+
tika

docs/source/readme.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
README.md
2+
==========
3+
4+
.. include:: ../../README.md
5+
:parser: myst_parser.sphinx_

docs/source/setup.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
setup module
2+
============
3+
4+
.. automodule:: setup
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/tika.rst

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
tika package
2+
============
3+
4+
Subpackages
5+
-----------
6+
7+
.. toctree::
8+
:maxdepth: 4
9+
10+
tika.tests
11+
12+
Submodules
13+
----------
14+
15+
tika.config module
16+
------------------
17+
18+
.. automodule:: tika.config
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
tika.detector module
24+
--------------------
25+
26+
.. automodule:: tika.detector
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
31+
tika.language module
32+
--------------------
33+
34+
.. automodule:: tika.language
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:
38+
39+
tika.parser module
40+
------------------
41+
42+
.. automodule:: tika.parser
43+
:members:
44+
:undoc-members:
45+
:show-inheritance:
46+
47+
tika.tika module
48+
----------------
49+
50+
.. automodule:: tika.tika
51+
:members:
52+
:undoc-members:
53+
:show-inheritance:
54+
55+
tika.translate module
56+
---------------------
57+
58+
.. automodule:: tika.translate
59+
:members:
60+
:undoc-members:
61+
:show-inheritance:
62+
63+
tika.unpack module
64+
------------------
65+
66+
.. automodule:: tika.unpack
67+
:members:
68+
:undoc-members:
69+
:show-inheritance:
70+
71+
Module contents
72+
---------------
73+
74+
.. automodule:: tika
75+
:members:
76+
:undoc-members:
77+
:show-inheritance:

docs/source/tika.tests.rst

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
tika.tests package
2+
==================
3+
4+
Submodules
5+
----------
6+
7+
tika.tests.memory\_benchmark module
8+
-----------------------------------
9+
10+
.. automodule:: tika.tests.memory_benchmark
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
tika.tests.test\_benchmark module
16+
---------------------------------
17+
18+
.. automodule:: tika.tests.test_benchmark
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
tika.tests.test\_from\_file\_service module
24+
-------------------------------------------
25+
26+
.. automodule:: tika.tests.test_from_file_service
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
31+
tika.tests.test\_ssl\_link module
32+
---------------------------------
33+
34+
.. automodule:: tika.tests.test_ssl_link
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:
38+
39+
tika.tests.test\_tika module
40+
----------------------------
41+
42+
.. automodule:: tika.tests.test_tika
43+
:members:
44+
:undoc-members:
45+
:show-inheritance:
46+
47+
tika.tests.tests\_params module
48+
-------------------------------
49+
50+
.. automodule:: tika.tests.tests_params
51+
:members:
52+
:undoc-members:
53+
:show-inheritance:
54+
55+
tika.tests.tests\_unpack module
56+
-------------------------------
57+
58+
.. automodule:: tika.tests.tests_unpack
59+
:members:
60+
:undoc-members:
61+
:show-inheritance:
62+
63+
tika.tests.utils module
64+
-----------------------
65+
66+
.. automodule:: tika.tests.utils
67+
:members:
68+
:undoc-members:
69+
:show-inheritance:
70+
71+
Module contents
72+
---------------
73+
74+
.. automodule:: tika.tests
75+
:members:
76+
:undoc-members:
77+
:show-inheritance:

0 commit comments

Comments
 (0)