Skip to content

Commit b11265d

Browse files
Docs: Initialisation de la documentation du projet (#20)
- Utilisation de la bibliothèque Sphinx - Ajout du dossier 'docs' contenant toute la documentation du projet - Ajout des fichiers .rst pour ajouter une page d'accueil ainsi que les modules dans la documentation - Modification des docstrings des classes dans le dossier donnees ( modification mot-clé Attributes en Args) afin d'éviter des erreurs de génération avec Sphinx
1 parent 1c5576b commit b11265d

20 files changed

Lines changed: 212 additions & 4 deletions

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ __pycache__/
1414

1515
# Fichiers propres à Coverage
1616
.coverage
17-
htmlcov/
17+
htmlcov/
18+
19+
# Fichiers de la documentation sphinx
20+
docs/build/

app/donnees/client_informations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ClientInformations:
1414
Cette classe regroupe les données extraites d'une entrée de log,
1515
qui concernent le client ayant effectué la requête au serveur Apache.
1616
17-
Attributes:
17+
Args:
1818
adresse_ip (str): L'adresse IP du client.
1919
identifiant_rfc (Optional[str]): L'identifiant RFC du client.
2020
Peut être None si non fournie.

app/donnees/reponse_informations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ReponseInformations:
1515
qui concernent les informations techniques sur la réponse émise par
1616
le serveur Apache au client.
1717
18-
Attributes:
18+
Args:
1919
code_statut_http (int): Le code de statut HTTP.
2020
taille_octets (Optional[int]): La taille de la réponse en octets.
2121
Peut être None si non fournie.

app/donnees/requete_informations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class RequeteInformations:
1515
qui concernent les informations techniques sur la requête émise au
1616
serveur Apache.
1717
18-
Attributes:
18+
Args:
1919
horodatage (datetime): L'horodatage de la requête.
2020
methode_http (Optional[str]): La méthode HTTP utilisée.
2121
Peut être None si non fournie.

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
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* Étendre le contenu principal sur toute la largeur */
2+
.wy-nav-content {
3+
max-width: 100%;
4+
}

docs/source/conf.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import os
2+
import sys
3+
4+
# Configuration file for the Sphinx documentation builder.
5+
#
6+
# For the full list of built-in configuration values, see the documentation:
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
8+
9+
# -- Project information -----------------------------------------------------
10+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
11+
12+
project = 'LogBuster'
13+
copyright = '2025, Anthony GUILLAUMA'
14+
author = 'Anthony GUILLAUMA'
15+
16+
# -- General configuration ---------------------------------------------------
17+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
18+
19+
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon']
20+
21+
templates_path = ['_templates']
22+
exclude_patterns = []
23+
24+
language = 'fr'
25+
26+
# Ajout du chemin vers les modules
27+
sys.path.insert(0, os.path.abspath('../../app'))
28+
29+
# -- Options for HTML output -------------------------------------------------
30+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
31+
32+
html_theme = 'sphinx_rtd_theme'
33+
html_static_path = ['_static']
34+
html_css_files = ["documentation.css"]
35+
html_theme_options = {
36+
"collapse_navigation": False, # Pour éviter la fermeture automatique
37+
"sticky_navigation": True, # Pour rendre le menu toujours visible
38+
"titles_only": False # Pour éviter de masquer les sous-sections
39+
}

docs/source/index.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. Documentation de LogBuster
2+
3+
Bienvenue dans la documentation de LogBuster
4+
============================================
5+
6+
LogBuster est un outil puissant pour analyser les fichiers de log Apache.
7+
Il vous permet de :
8+
9+
- Extraire des statistiques clés.
10+
- Exporter les données en JSON.
11+
- Gérer les erreurs de format avec précision.
12+
13+
.. toctree::
14+
:maxdepth: 4
15+
:caption: Contenu
16+
:numbered:
17+
18+
modules/index_modules.rst
19+
20+
---
21+
22+
© 2025 - Projet LogBuster
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CLI
2+
===========
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
parseur_arguments_cli.rst

0 commit comments

Comments
 (0)