Skip to content

Commit 6c9502f

Browse files
Merge branch 'development'
- closes #10 and 11 - sphinx documentation
2 parents ac19e41 + 80a288b commit 6c9502f

28 files changed

+512
-140
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ coverage.xml
3232
.vscode
3333
.pytest_cache/
3434
.coverage
35+
36+
# Sphinx documentation
37+
docs/_build/*

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Lorenzo Felletti
3+
Copyright (c) 2021-2022 Lorenzo Felletti
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## What is it
44

5-
Pyregex(p) is a Regex Engine with backtracking and all major regular-expressions' features.
5+
Pyregex(p) is a backtracking Regex Engine complete with all major regular-expressions' features.
66

77
It is composed of a Lexer, a Parser (a TDRD parser) and finally the Engine.
88

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 = .
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/conf.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
15+
sys.path.insert(0, os.path.abspath('..'))
16+
17+
import pyregexp
18+
19+
# -- Project information -----------------------------------------------------
20+
21+
project = 'pyregexp'
22+
copyright = '2022, Lorenzo Felletti'
23+
author = 'Lorenzo Felletti'
24+
25+
26+
# -- General configuration ---------------------------------------------------
27+
28+
# Add any Sphinx extension module names here, as strings. They can be
29+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
30+
# ones.
31+
extensions = [
32+
'sphinx.ext.autodoc',
33+
'sphinx.ext.napoleon',
34+
'sphinx.ext.viewcode',
35+
]
36+
37+
# Add any paths that contain templates here, relative to this directory.
38+
templates_path = ['_templates']
39+
40+
# List of patterns, relative to source directory, that match files and
41+
# directories to ignore when looking for source files.
42+
# This pattern also affects html_static_path and html_extra_path.
43+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
44+
45+
46+
# -- Options for HTML output -------------------------------------------------
47+
48+
# The theme to use for HTML and HTML Help pages. See the documentation for
49+
# a list of builtin themes.
50+
#
51+
html_theme = 'alabaster'
52+
53+
# Add any paths that contain custom static files (such as style sheets) here,
54+
# relative to this directory. They are copied after the builtin static files,
55+
# so a file named "default.css" will overwrite the builtin "default.css".
56+
html_static_path = ['_static']

docs/index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. pyregexp documentation master file, created by
2+
sphinx-quickstart on Wed Mar 23 17:24:22 2022.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to pyregexp's documentation!
7+
====================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
14+
15+
Indices and tables
16+
==================
17+
18+
* :ref:`genindex`
19+
* :ref:`modindex`
20+
* :ref:`search`

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=.
11+
set BUILDDIR=_build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.https://www.sphinx-doc.org/
25+
exit /b 1
26+
)
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

docs/modules.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pyregexp
2+
========
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
pyregexp

docs/pyregexp.rst

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
pyregexp package
2+
================
3+
4+
Submodules
5+
----------
6+
7+
pyregexp.engine module
8+
----------------------
9+
10+
.. figure:: /uml/classes.engine.png
11+
:alt: engine.py uml diagram
12+
:width: 100%
13+
14+
*UML of all pyregexp.engine classes.*
15+
16+
.. automodule:: pyregexp.engine
17+
:members:
18+
:undoc-members:
19+
:show-inheritance:
20+
21+
pyregexp.lexer module
22+
---------------------
23+
24+
.. figure:: /uml/classes.lexer.png
25+
:alt: lexer.py uml diagram
26+
:width: 25%
27+
28+
*UML of all pyregexp.lexer classes.*
29+
30+
.. automodule:: pyregexp.lexer
31+
:members:
32+
:undoc-members:
33+
:show-inheritance:
34+
35+
pyregexp.match module
36+
---------------------
37+
38+
.. figure:: /uml/classes.match.png
39+
:alt: match.py uml diagram
40+
:width: 70%
41+
42+
*UML of all pyregexp.match classes.*
43+
44+
.. automodule:: pyregexp.match
45+
:members:
46+
:undoc-members:
47+
:show-inheritance:
48+
49+
pyregexp.pyrser module
50+
----------------------
51+
52+
.. figure:: /uml/classes.pyrser.png
53+
:alt: pyrser.py uml diagram
54+
:width: 20%
55+
56+
*UML of all pyregexp.pyrser classes.*
57+
58+
.. automodule:: pyregexp.pyrser
59+
:members:
60+
:undoc-members:
61+
:show-inheritance:
62+
63+
pyregexp.re\_ast module
64+
-----------------------
65+
66+
.. figure:: /uml/classes.re_ast.png
67+
:alt: re_ast.py uml diagram
68+
:width: 100%
69+
70+
*UML of all pyregexp.re_ast classes.*
71+
72+
.. automodule:: pyregexp.re_ast
73+
:members:
74+
:undoc-members:
75+
:show-inheritance:
76+
77+
pyregexp.tokens module
78+
----------------------
79+
80+
.. figure:: /uml/classes.tokens.png
81+
:alt: tokens.py uml diagram
82+
:width: 100%
83+
84+
*UML of all pyregexp.tokens classes.*
85+
86+
.. automodule:: pyregexp.tokens
87+
:members:
88+
:undoc-members:
89+
:show-inheritance:
90+
91+
Module contents
92+
---------------
93+
94+
.. figure:: /uml/classes.pyregexp.png
95+
:alt: pyregexp uml diagram
96+
:width: 100%
97+
98+
*UML of all pyregexp classes.*
99+
100+
.. figure:: /uml/packages.pyregexp.png
101+
:alt: packages uml diagram
102+
:scale: 70%
103+
104+
*UML of pyregexp packages.*
105+
106+
.. automodule:: pyregexp
107+
:members:
108+
:undoc-members:
109+
:show-inheritance:

docs/uml/classes.engine.png

13.5 KB
Loading

0 commit comments

Comments
 (0)