Skip to content

Commit

Permalink
chore: added sphinx documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Devasy23 committed Sep 13, 2024
1 parent 9f97d1a commit 8ef11b6
Show file tree
Hide file tree
Showing 12 changed files with 279 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -14,7 +14,7 @@ repos:
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
rev: v3.13.0
hooks:
- id: reorder-python-imports
args: [--py38-plus, --add-import, 'from __future__ import annotations']
Expand All @@ -23,12 +23,12 @@ repos:
hooks:
- id: add-trailing-comma
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.1
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/hhatto/autopep8
rev: v2.1.0
rev: v2.3.1
hooks:
- id: autopep8
# - repo: https://github.com/PyCQA/flake8
Expand All @@ -46,7 +46,7 @@ repos:
# additional_dependencies: [wily]

- repo: https://github.com/commitizen-tools/commitizen
rev: master
rev: v3.29.0
hooks:
- id: commitizen
stages: [commit-msg]
19 changes: 19 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# .readthedocs.yaml

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: requirements.txt
Empty file added FaceRec/__init__.py
Empty file.
21 changes: 21 additions & 0 deletions docs/FaceRec.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FaceRec package
===============

Submodules
----------

FaceRec.config module
---------------------

.. automodule:: FaceRec.config
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: FaceRec
:members:
:undoc-members:
:show-inheritance:
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -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)
49 changes: 49 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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

import os
import sys
sys.path.insert(0, os.path.abspath(".."))


# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'FaceRec'
copyright = '2024, Devansh Shah, Devasy Patel'
author = 'Devansh Shah, Devasy Patel'
release = '1.0.0'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"myst_parser", # Add this line
]
# Include markdown support
myst_enable_extensions = [
"colon_fence",
"html_image",
]
source_suffix = {
".rst": "restructuredtext",
".md": "markdown", # Add this line to recognize markdown files
}
# 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 = ["_build", "Thumbs.db", ".DS_Store"]

# -- 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"]
27 changes: 27 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. FaceRec documentation master file, created by
sphinx-quickstart on Fri Sep 13 19:27:12 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
FaceRec documentation
=====================

Add your content using ``reStructuredText`` syntax. See the
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
documentation for details.


.. toctree::
:maxdepth: 2
:caption: Contents:


.. include:: FaceRec.rst
.. include:: modules.rst
.. include:: route.rst
.. include:: testing.rst

Project Overview
================

.. include:: ../README.md
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
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
7 changes: 7 additions & 0 deletions docs/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
route
=====

.. toctree::
:maxdepth: 4

route
10 changes: 10 additions & 0 deletions docs/route.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
route package
=============

Module contents
---------------

.. automodule:: route
:members:
:undoc-members:
:show-inheritance:
37 changes: 37 additions & 0 deletions docs/testing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
testing package
===============

Submodules
----------

testing.test\_database module
-----------------------------

.. automodule:: testing.test_database
:members:
:undoc-members:
:show-inheritance:

testing.test\_face\_cycle module
--------------------------------

.. automodule:: testing.test_face_cycle
:members:
:undoc-members:
:show-inheritance:

testing.test\_face\_endpoints module
------------------------------------

.. automodule:: testing.test_face_endpoints
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: testing
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit 8ef11b6

Please sign in to comment.