lucas066001 commited on
Commit
209e94d
·
1 Parent(s): ca90d70

feat(docs): Adding documentation generation

Browse files
.github/workflows/doc.yml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Documentation production
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - "**"
10
+ # Will need to be restricted to main branch in the future
11
+ pull_request:
12
+ branches:
13
+ - "**"
14
+
15
+ jobs:
16
+ build:
17
+
18
+ runs-on: ubuntu-latest
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ python-version: ["3.12"]
23
+
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - name: Set up Python ${{ matrix.python-version }}
27
+ uses: actions/setup-python@v3
28
+ with:
29
+ python-version: ${{ matrix.python-version }}
30
+
31
+ - name: Install dependencies
32
+ run: |
33
+ python -m pip install --upgrade pip
34
+ python -m pip install flake8 pytest sphinx sphinxawesome-theme
35
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
36
+
37
+ - name: Build html documentation
38
+ run: |
39
+ cd ./docs && make html
40
+
41
+ - name: Deploy documentation
42
+ uses: peaceiris/actions-gh-pages@v3
43
+ with:
44
+ github_token: ${{ secrets.GITHUB_TOKEN }}
45
+ publish_dir: docs
App/travel_resolver/libs/sample/greeter.py CHANGED
@@ -1,7 +1,19 @@
1
  class GreeterHelper():
2
  def __init__(self):
 
 
 
3
  self._base_message = "Hello ! "
4
 
5
- def Greet(self, message):
 
 
 
 
 
 
 
 
 
6
  print(self._base_message + message)
7
  return "Hello ! " + message
 
1
  class GreeterHelper():
2
  def __init__(self):
3
+ """
4
+ Initialize base private attributes with sample values.
5
+ """
6
  self._base_message = "Hello ! "
7
 
8
+ def Greet(self, message: str):
9
+ """
10
+ Print greeting message in the terminal.
11
+
12
+ Args:
13
+ message (str): Message that will be included in greeting.
14
+
15
+ Returns:
16
+ (str): The full printed message.
17
+ """
18
  print(self._base_message + message)
19
  return "Hello ! " + message
docs/Makefile ADDED
@@ -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 = .
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/conf.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ from pathlib import Path
10
+ import sys
11
+ html_theme = 'sphinxawesome_theme'
12
+
13
+ project = 'TravelOrderResolver'
14
+ copyright = '2024, Azar, Chapuis, Thanh, Goupil, Duquesnoy'
15
+ author = 'Azar, Chapuis, Thanh, Goupil, Duquesnoy'
16
+
17
+ sys.path.insert(0, (Path(__file__).parents[1].resolve() / 'App').as_posix())
18
+
19
+ # -- General configuration ---------------------------------------------------
20
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
21
+
22
+ extensions = [
23
+ 'sphinx.ext.duration',
24
+ 'sphinx.ext.doctest',
25
+ 'sphinx.ext.autodoc',
26
+ 'sphinx.ext.autosummary'
27
+ ]
28
+
29
+ templates_path = ['_templates']
30
+ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
31
+
32
+
33
+ # -- Options for HTML output -------------------------------------------------
34
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
docs/index.rst ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .. TravelOrderResolver documentation master file, created by
2
+ sphinx-quickstart on Tue Sep 3 14:51:06 2024.
3
+ You can adapt this file completely to your liking, but it should at least
4
+ contain the root `toctree` directive.
5
+
6
+ TravelOrderResolver documentation
7
+ =================================
8
+
9
+ Add your content using ``reStructuredText`` syntax. See the
10
+ `reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
11
+ documentation for details.
12
+
13
+
14
+ .. toctree::
15
+ :maxdepth: 5
16
+ :caption: Contents:
17
+
18
+ .. toctree::
19
+ travel_resolver
docs/make.bat ADDED
@@ -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=.
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/travel_resolver.libs.ner.rst ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ travel\_resolver.libs.ner package
2
+ =================================
3
+
4
+ .. automodule:: travel_resolver.libs.ner
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
docs/travel_resolver.libs.pathfinder.rst ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ travel\_resolver.libs.pathfinder package
2
+ ========================================
3
+
4
+ .. automodule:: travel_resolver.libs.pathfinder
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
docs/travel_resolver.libs.rst ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ travel\_resolver.libs package
2
+ =============================
3
+
4
+ .. toctree::
5
+ :maxdepth: 4
6
+
7
+ travel_resolver.libs.ner
8
+ travel_resolver.libs.pathfinder
9
+ travel_resolver.libs.sample
10
+ travel_resolver.libs.speech2text
11
+
12
+ .. automodule:: travel_resolver.libs
13
+ :members:
14
+ :undoc-members:
15
+ :show-inheritance:
docs/travel_resolver.libs.sample.greeter.rst ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ travel\_resolver.libs.sample.greeter module
2
+ ===========================================
3
+
4
+ .. automodule:: travel_resolver.libs.sample.greeter
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
docs/travel_resolver.libs.sample.rst ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ travel\_resolver.libs.sample package
2
+ ====================================
3
+
4
+ .. toctree::
5
+ :maxdepth: 4
6
+
7
+ travel_resolver.libs.sample.greeter
8
+
9
+ .. automodule:: travel_resolver.libs.sample
10
+ :members:
11
+ :undoc-members:
12
+ :show-inheritance:
docs/travel_resolver.libs.speech2text.rst ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ travel\_resolver.libs.speech2text package
2
+ =========================================
3
+
4
+ .. automodule:: travel_resolver.libs.speech2text
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
docs/travel_resolver.rst ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ travel\_resolver package
2
+ ========================
3
+
4
+ .. toctree::
5
+ :maxdepth: 4
6
+
7
+ travel_resolver.libs
8
+ travel_resolver.tests
9
+
10
+ .. automodule:: travel_resolver
11
+ :members:
12
+ :undoc-members:
13
+ :show-inheritance:
docs/travel_resolver.tests.rst ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ travel\_resolver.tests package
2
+ ==============================
3
+
4
+ .. toctree::
5
+ :maxdepth: 4
6
+
7
+ travel_resolver.tests.sample_test
8
+
9
+ .. automodule:: travel_resolver.tests
10
+ :members:
11
+ :undoc-members:
12
+ :show-inheritance:
docs/travel_resolver.tests.sample_test.rst ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ travel\_resolver.tests.sample\_test module
2
+ ==========================================
3
+
4
+ .. automodule:: travel_resolver.tests.sample_test
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance: