From 49c21e1857bc71bb6d147284cd929e6436244626 Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Santos Souza de Miranda Date: Tue, 20 May 2025 02:40:54 -0300 Subject: [PATCH] Added Documentation using Sphinx to the project --- docs/Makefile | 20 ++++++++ docs/make.bat | 35 ++++++++++++++ docs/source/conf.py | 47 +++++++++++++++++++ .../goulag_sort_detailed_explanation.rst | 4 ++ docs/source/goulagsort_package.rst | 8 ++++ docs/source/index.rst | 25 ++++++++++ docs/source/modules.rst | 7 +++ requirements.txt | 3 ++ 8 files changed, 149 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/make.bat create mode 100644 docs/source/conf.py create mode 100644 docs/source/goulag_sort_detailed_explanation.rst create mode 100644 docs/source/goulagsort_package.rst create mode 100644 docs/source/index.rst create mode 100644 docs/source/modules.rst create mode 100644 requirements.txt diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -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 = source +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) diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..dc1312a --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..49ddece --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,47 @@ +import os +import sys +from recommonmark.transform import AutoStructify +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = 'goulagSort' +copyright = '2025, Gustavo Henrique Santos Souza de Miranda' +author = 'Gustavo Henrique Santos Souza de Miranda' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = ['sphinx.ext.autodoc', + 'sphinx.ext.napoleon', + 'sphinx.ext.viewcode', + 'sphinx.ext.todo', + 'recommonmark' + ] + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'sphinx_rtd_theme' +html_static_path = ['_static'] + + + +def setup(app): + app.add_config_value('recommonmark_config', { + 'auto_toc_tree_section': 'Contents', + 'enable_math': False, + 'enable_proxy_refs': False, + 'enable_css_classes': True, + 'enable_eval_rst': True, + }, True) + app.add_transform(AutoStructify) \ No newline at end of file diff --git a/docs/source/goulag_sort_detailed_explanation.rst b/docs/source/goulag_sort_detailed_explanation.rst new file mode 100644 index 0000000..98945a5 --- /dev/null +++ b/docs/source/goulag_sort_detailed_explanation.rst @@ -0,0 +1,4 @@ +.. _goulag_sort_detailed_explanation: + +Goulag Sort Explained +======================== \ No newline at end of file diff --git a/docs/source/goulagsort_package.rst b/docs/source/goulagsort_package.rst new file mode 100644 index 0000000..2e5c3b5 --- /dev/null +++ b/docs/source/goulagsort_package.rst @@ -0,0 +1,8 @@ +goulag_sort Package +=================== + +.. automodule:: goulag_sort + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..02621b9 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,25 @@ +.. Goulag Sort documentation master file, created by + sphinx-quickstart on [SUA_DATA_AQUI]. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Bem-vindo à documentação do Goulag Sort! +========================================== + +Esta é a documentação da biblioteca Goulag Sort, que implementa um algoritmo de ordenação intencionalmente ineficiente. + +.. toctree:: + :maxdepth: 6 + :caption: Contents: + + modules + goulag_sort_detailed_explanation + + + +Index and Tables +================= + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` \ No newline at end of file diff --git a/docs/source/modules.rst b/docs/source/modules.rst new file mode 100644 index 0000000..2b13c65 --- /dev/null +++ b/docs/source/modules.rst @@ -0,0 +1,7 @@ +goulag_sort +=========== + +.. toctree:: + :maxdepth: 4 + + goulagsort_package diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a7de4ad --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +recommonmark~=0.7.1 +pytest~=8.3.5 +setuptools~=68.2.0 \ No newline at end of file