From 6ee34bb22a4f67a1e30b5b1cde514b942aa80b6f Mon Sep 17 00:00:00 2001 From: Patrick Chabrier <patrick.chabrier@inrae.fr> Date: Thu, 3 Feb 2022 19:49:20 +0100 Subject: [PATCH 1/3] docs: provide Sphinx documentation generator --- .gitlab-ci.yml | 12 +++++++++ docs/source/conf.py | 60 +++++++++++++++++++++++++++++++++++++++++++ docs/source/index.rst | 21 +++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 docs/source/conf.py create mode 100644 docs/source/index.rst diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 95c5238..e9e0273 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -100,3 +100,15 @@ export_jupyternb: paths: - ${JUPYTERNB_FOLDER}${JUPYTERNB_FILE}.html needs: ["build_docker"] + +build_documentation: + image: python:3.7-alpine + script: + - apk add --no-cache make + - pip install -U sphinx + - pip install sphinx-rtd-theme + - sphinx-apidoc -o docs/source gtnash + - sphinx-build -b html docs/source public + artifacts: + paths: + - public diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..2d757f5 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,60 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# 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 os +import sys +sys.path.insert(0, os.path.abspath('../../gtnash/game')) +sys.path.insert(0, os.path.abspath('../../gtnash')) +sys.path.insert(0, os.path.abspath('../..')) + + +# -- Project information ----------------------------------------------------- + +project = 'GTNash' +copyright = '2022, Paul Jourdan, Régis Sabbadin' +author = 'Paul Jourdan, Régis Sabbadin' + +# The full version, including alpha/beta/rc tags +release = '0.1' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = ['sphinx.ext.autodoc'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'sphinx_rtd_theme' + + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +autodoc_mock_imports = ["numpy", "sage"] + diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..2cf2e26 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,21 @@ +.. GTNash documentation master file, created by + sphinx-quickstart on Thu Feb 3 13:20:54 2022. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to GTNash's documentation! +================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + modules + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` -- GitLab From 529567cd928fd40f6a223c7829aae2c53ed56a89 Mon Sep 17 00:00:00 2001 From: Patrick Chabrier <patrick.chabrier@inra.fr> Date: Fri, 4 Feb 2022 09:10:14 +0100 Subject: [PATCH 2/3] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9e0273..9157f26 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,3 @@ - variables: DOCKER_HOST: tcp://docker:2376 DOCKER_TLS_CERTDIR: "/certs" @@ -101,7 +100,7 @@ export_jupyternb: - ${JUPYTERNB_FOLDER}${JUPYTERNB_FILE}.html needs: ["build_docker"] -build_documentation: +pages: image: python:3.7-alpine script: - apk add --no-cache make -- GitLab From ce37b4341077d86db69352cde3c59ecb2ad569fd Mon Sep 17 00:00:00 2001 From: Patrick Chabrier <patrick.chabrier@inra.fr> Date: Fri, 4 Feb 2022 09:40:26 +0100 Subject: [PATCH 3/3] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9157f26..3a6db60 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -103,7 +103,6 @@ export_jupyternb: pages: image: python:3.7-alpine script: - - apk add --no-cache make - pip install -U sphinx - pip install sphinx-rtd-theme - sphinx-apidoc -o docs/source gtnash -- GitLab