Skip to content

Commit

Permalink
Add frontend documentation + Add api references (front and back) in d…
Browse files Browse the repository at this point in the history
…ocumentation + change GH actions
  • Loading branch information
jacquesfize committed Oct 25, 2023
1 parent 64440e0 commit ea78190
Show file tree
Hide file tree
Showing 12 changed files with 120 additions and 64 deletions.
62 changes: 42 additions & 20 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
name: "Build Sphinx Documentation"

on:
release:
types: [published]
on:
push:
branches:
- update-doc
pull_request:
branches:
- update-doc
# release:
# types: [published]

jobs:
docs:
Expand All @@ -24,20 +30,36 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Build and Commit
uses: sphinx-notes/pages@v2
with:
requirements_path: docs/requirements.txt
env:
GEONATURE_CONFIG_FILE: config/test_config.toml
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
- uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: actions/checkout@master
with:
fetch-depth: 0
ref: update-doc

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: lts/gallium

- name: Install JS librairies
working-directory: ./frontend
run: npm install

- name: Build JS documentation
working-directory: ./frontend
run: npm run docBuild

- name: Build and Commit
uses: sphinx-notes/pages@v2
with:
requirements_path: docs/requirements.txt
env:
GEONATURE_CONFIG_FILE: config/test_config.toml

# - name: Push changes
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: gh-pages
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/external_doc/documentation_js

# PyBuilder
target/
Expand Down
2 changes: 1 addition & 1 deletion backend/requirements-dev.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-r requirements-common.in
-r requirements-submodules.in
-r requirements-submodules.in
6 changes: 6 additions & 0 deletions docs/api-references.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
API REFERENCES
==============

.. toctree::
../../autoapi/geonature/index
frontend
16 changes: 12 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import sys, os

sys.path.insert(0, os.path.abspath("../backend"))

# -- General configuration ------------------------------------------------

Expand All @@ -38,6 +41,13 @@
"myst_parser",
]

## AUTOAPI
extensions.append("autoapi.extension")
autoapi_dirs = ["../backend/geonature"]
autoapi_ignore = ["*migrations*", "*tests*"]
autoapi_add_toctree_entry = False


# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down Expand Up @@ -126,9 +136,7 @@
# ]
# }

html_extra_path = [
"CNAME",
]
html_extra_path = ["CNAME", "sources/"]


# -- Options for HTMLHelp output ------------------------------------------
Expand Down Expand Up @@ -186,4 +194,4 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"https://docs.python.org/": None}
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
Empty file added docs/external_doc/.gitkeep
Empty file.
5 changes: 5 additions & 0 deletions docs/frontend.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Frontend
--------
La documentation pour le frontend de Geonature se trouve ici_.

.. _ici: documentation_js/index.html
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Bienvenue dans la documentation de GeoNature
FAQ
authors
CHANGELOG
api-references

1 change: 1 addition & 0 deletions docs/requirements.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sphinx
sphinx_rtd_theme
myst-parser
sphinx-autoapi
79 changes: 42 additions & 37 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
#
# This file is autogenerated by pip-compile with python 3.7
# To update, run:
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements.in
#
alabaster==0.7.12
alabaster==0.7.13
# via sphinx
babel==2.10.3
anyascii==0.3.2
# via sphinx-autoapi
astroid==3.0.1
# via sphinx-autoapi
babel==2.13.1
# via sphinx
certifi==2022.9.14
certifi==2023.7.22
# via requests
charset-normalizer==2.1.1
charset-normalizer==3.3.1
# via requests
docutils==0.17.1
docutils==0.18.1
# via
# myst-parser
# sphinx
Expand All @@ -21,63 +25,64 @@ idna==3.4
# via requests
imagesize==1.4.1
# via sphinx
importlib-metadata==4.12.0
# via sphinx
jinja2==3.1.2
# via
# myst-parser
# sphinx
markdown-it-py==2.1.0
# sphinx-autoapi
markdown-it-py==3.0.0
# via
# mdit-py-plugins
# myst-parser
markupsafe==2.1.1
markupsafe==2.1.3
# via jinja2
mdit-py-plugins==0.3.3
mdit-py-plugins==0.4.0
# via myst-parser
mdurl==0.1.2
# via markdown-it-py
myst-parser==0.18.1
myst-parser==2.0.0
# via -r requirements.in
packaging==21.3
packaging==23.2
# via sphinx
pygments==2.13.0
pygments==2.16.1
# via sphinx
pyparsing==3.0.9
# via packaging
pytz==2022.2.1
# via babel
pyyaml==6.0
# via myst-parser
requests==2.28.1
pyyaml==6.0.1
# via
# myst-parser
# sphinx-autoapi
requests==2.31.0
# via sphinx
snowballstemmer==2.2.0
# via sphinx
sphinx==5.1.1
sphinx==7.2.6
# via
# -r requirements.in
# myst-parser
# sphinx-autoapi
# sphinx-rtd-theme
sphinx-rtd-theme==1.0.0
# sphinxcontrib-applehelp
# sphinxcontrib-devhelp
# sphinxcontrib-htmlhelp
# sphinxcontrib-jquery
# sphinxcontrib-qthelp
# sphinxcontrib-serializinghtml
sphinx-autoapi==3.0.0
# via -r requirements.in
sphinxcontrib-applehelp==1.0.2
sphinx-rtd-theme==1.3.0
# via -r requirements.in
sphinxcontrib-applehelp==1.0.7
# via sphinx
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-devhelp==1.0.5
# via sphinx
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-htmlhelp==2.0.4
# via sphinx
sphinxcontrib-jquery==4.1
# via sphinx-rtd-theme
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-qthelp==1.0.6
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
sphinxcontrib-serializinghtml==1.1.9
# via sphinx
typing-extensions==4.3.0
# via
# importlib-metadata
# markdown-it-py
# myst-parser
urllib3==1.26.12
urllib3==2.0.7
# via requests
zipp==3.8.1
# via importlib-metadata
6 changes: 4 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"format": "prettier --config .prettierrc --ignore-path .prettierignore --write '**/*.ts' '../contrib/*/frontend/**/*.ts'",
"format:check": "prettier --config .prettierrc --ignore-path .prettierignore --check '**/*.ts' '../contrib/*/frontend/**/*.ts'",
"cypress:open": "cypress open",
"cypress:run": "cypress run"
"cypress:run": "cypress run",
"docBuild" : "npx compodoc -p tsconfig.doc.json -d ../docs/external_doc/documentation_js"
},
"private": true,
"dependencies": {
Expand Down Expand Up @@ -66,6 +67,7 @@
"cypress": "^9.2.1",
"cypress-promise": "^1.1.0",
"prettier": "^2.5.0",
"typescript": "4.9.4"
"typescript": "4.9.4",
"@compodoc/compodoc":"^1.1.22"
}
}
4 changes: 4 additions & 0 deletions frontend/tsconfig.doc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"include": ["src/**/*.ts"],
"exclude": ["src/test.ts", "src/**/*.spec.ts", "src/app/file-to-exclude.ts"]
}

0 comments on commit ea78190

Please sign in to comment.