1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 06:22:22 +00:00

Prepare documentation on /doc

This commit is contained in:
Yohann D'ANELLO 2021-01-20 15:00:26 +01:00
parent 01e6ab2279
commit ddaf5e82bd
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
6 changed files with 116 additions and 1 deletions

View File

@ -8,13 +8,18 @@ RUN apk add --no-cache gettext nginx gcc libc-dev libffi-dev libxml2-dev libxslt
RUN apk add --no-cache bash RUN apk add --no-cache bash
RUN mkdir /code RUN mkdir /code /code/docs
WORKDIR /code WORKDIR /code
COPY requirements.txt /code/requirements.txt COPY requirements.txt /code/requirements.txt
COPY docs/requirements.txt /code/docs/requirements.txt
RUN pip install -r requirements.txt --no-cache-dir RUN pip install -r requirements.txt --no-cache-dir
RUN pip install -r docs/requirements.txt --no-cache-dir
COPY . /code/ COPY . /code/
# Compile documentation
RUN sphinx-build -M html docs docs/_build
RUN python manage.py collectstatic --noinput && \ RUN python manage.py collectstatic --noinput && \
python manage.py compilemessages python manage.py compilemessages

20
docs/Makefile Normal file
View File

@ -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 = .
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)

60
docs/conf.py Normal file
View File

@ -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('.'))
# -- Project information -----------------------------------------------------
project = 'Plateforme du TFJM²'
copyright = "2020-2021"
author = "Animath"
# -- 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_rtd_theme",
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'fr'
# 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 = ['_build']
# -- 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']

23
docs/index.rst Normal file
View File

@ -0,0 +1,23 @@
Documentation de la plateforme du TFJM²
=======================================
.. image:: https://gitlab.com/animath/si/plateforme-tfjm/badges/master/pipeline.svg
:target: https://gitlab.com/animath/si/plateforme-tfjm/-/commits/master
:alt: Pipeline status
.. image:: https://gitlab.com/animath/si/plateforme-tfjm/badges/master/coverage.svg
:target: https://gitlab.com/animath/si/plateforme-tfjm/-/commits/master
:alt: Coverage report
.. image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg
:target: https://www.gnu.org/licenses/gpl-3.0.txt
:alt: License: GPL v3
.. toctree::
:maxdepth: 3
:caption: Développer
.. toctree::
:maxdepth: 3
:caption: Jouer

2
docs/requirements.txt Normal file
View File

@ -0,0 +1,2 @@
sphinx>=3.3
sphinx-rtd-theme>=0.5

View File

@ -5,6 +5,7 @@ upstream tfjm {
server { server {
listen 80; listen 80;
server_name tfjm; server_name tfjm;
charset utf-8;
client_max_body_size 50M; client_max_body_size 50M;
location / { location / {
@ -17,4 +18,8 @@ server {
location /static { location /static {
alias /code/static/; alias /code/static/;
} }
location /doc {
alias /code/docs/_build/html/;
}
} }