Skip to content

Commit a4d0aa6

Browse files
committed
23 | Add documentary
1 parent 291707f commit a4d0aa6

File tree

95 files changed

+1075
-500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1075
-500
lines changed

.github/workflows/deploy-docs.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy Sphinx Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v3
15+
16+
- name: Setup Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.x'
20+
21+
- name: Install Dependencies
22+
run: |
23+
pip install sphinx sphinx_rtd_theme
24+
25+
- name: Build Documentation
26+
run: |
27+
sphinx-build -b html docs/ docs/_build/html
28+
29+
- name: Deploy to GitHub Pages
30+
uses: peaceiris/actions-gh-pages@v3
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: docs/_build/html

CHAGELOG.md

Lines changed: 0 additions & 78 deletions
This file was deleted.

CREATE_OWN.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

DEVELOPMENT.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

EXTERNAL_API.md

Lines changed: 0 additions & 118 deletions
This file was deleted.

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)

README.rst

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
11
flask-inputfilter
22
==================================
33

4-
The `InputFilter` class is used to validate and filter input data in Flask applications.
4+
The ``InputFilter`` class is used to validate and filter input data in Flask applications.
55
It provides a modular way to clean and ensure that incoming data meets expected format
66
and type requirements before being processed.
77

8+
.. raw:: html
9+
10+
<div style="border:1px solid #86989B;padding:1rem;border-radius:3px;background-color:#f7f7f7;">
11+
<p style="background-color:hsl(219.5, 84%, 90%);margin:-1rem -1rem 0.8rem -1rem;padding:0.3rem 1rem 0.3rem 2.5rem;position:relative;border-radius:3px 3px 0 0;">
12+
<span style="content:'';position:absolute;top:.25rem;left:.5rem;width:1.5rem;height:1.5rem;background-color:hsl(219.5, 84%, 50%);mask-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');"></span>
13+
Tip
14+
</p>
15+
<p style="margin:0;">
16+
Thank you for using <code>flask-inputfilter</code>!<br>
17+
If you have any questions or suggestions, please feel free to open an issue on GitHub <a href="https://github.com/LeanderCS/flask-inputfilter">here</a>.<br>
18+
If you don't want to miss any updates, please star the repository.<br>
19+
This will help me to understand how many people are interested in this project.<br>
20+
</p>
21+
</div>
22+
23+
.. raw:: html
24+
25+
<div style="border:1px solid #86989B;padding:1rem;border-radius:3px;background-color:#f7f7f7;">
26+
<p style="background-color:hsl(150, 36.7%, 90%);margin:-1rem -1rem 0.8rem -1rem;padding:0.3rem 1rem 0.3rem 2.5rem;position:relative;border-radius:3px 3px 0 0;">
27+
<span style="content:'';position:absolute;top:.25rem;left:.5rem;width:1.5rem;height:1.5rem;background-color:hsl(150, 36.7%, 50%);mask-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');"></span>
28+
Hint
29+
</p>
30+
<p style="margin:0;">
31+
For information about the usage you can view the documentation
32+
</p>
33+
</div>
34+
835
:Test Status:
936

1037
.. image:: https://img.shields.io/github/actions/workflow/status/LeanderCS/flask-inputfilter/test.yaml?branch=main&style=flat-square&label=Github%20Actions
@@ -37,10 +64,10 @@ Installation
3764
Quickstart
3865
==========
3966

40-
To use the `InputFilter` class, create a new class that inherits from it and define the
67+
To use the ``InputFilter`` class, create a new class that inherits from it and define the
4168
fields you want to validate and filter.
4269

43-
There are numerous filters and validators available, but you can also create your `own <CREATE_OWN.md>`_.
70+
There are numerous filters and validators available, but you can also create your `own <CreateOwn.md>`_.
4471

4572
Definition
4673
----------
@@ -92,8 +119,8 @@ Definition
92119
Usage
93120
-----
94121

95-
To use the `InputFilter` class, call the `validate` method on the class instance.
96-
After calling `validate`, the validated data will be available in `g.validated_data`.
122+
To use the ``InputFilter`` class, call the ``validate`` method on the class instance.
123+
After calling ``validate``, the validated data will be available in ``g.validated_data``.
97124
If the data is invalid, a 400 response with an error message will be returned.
98125

99126
.. code-block:: python
@@ -112,33 +139,17 @@ If the data is invalid, a 400 response with an error message will be returned.
112139
id = data.get('id')
113140
zipcode = data.get('zipcode')
114141
115-
Options
116-
=======
117-
118-
The `add` method supports several options:
119-
120-
- `Required`_
121-
- `Filter <flask_inputfilter/Filter/README.md>`_
122-
- `Validator <flask_inputfilter/Validator/README.md>`_
123-
- `Default`_
124-
- `Fallback`_
125-
- `ExternalApi <EXTERNAL_API.md>`_
126-
127-
Required
128-
--------
129-
130-
The `required` option specifies whether the field must be included in the input data.
131-
If the field is missing, a `ValidationError` will be raised with an appropriate error message.
132-
133-
Default
134-
-------
135142
136-
The `default` option allows you to specify a default value to use if the field is not
137-
present in the input data.
143+
.. raw:: html
138144

139-
Fallback
140-
--------
145+
<div style="border:1px solid #86989B;padding:1rem;border-radius:3px;background-color:#f7f7f7;">
146+
<p style="background-color:hsl(150, 36.7%, 90%);margin: -1rem -1rem 0.8rem -1rem;padding:0.3rem 1rem 0.3rem 2.5rem;position:relative;border-radius:3px 3px 0 0;">
147+
<span style="content:'';position:absolute;top:.25rem;left:.5rem;width:1.5rem;height:1.5rem;background-color:hsl(150,36.7%,50%);mask-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot;><path d=&quot;M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z&quot;/></svg>');"></span>
148+
Tip
149+
</p>
150+
<p style="margin:0;">
151+
For further instructions please view the documentary `Here <https://github.com/LeanderCS/flask-inputfilter.<br>
141152

142-
The `fallback` option specifies a value to use if validation fails or required data
143-
is missing. Note that if the field is optional and absent, `fallback` will not apply;
144-
use `default` in such cases.
153+
For ideas, suggestions or questions, please open an issue on GitHub <a href="https://github.com/LeanderCS/flask-inputfilter">here</a>.
154+
</p>
155+
</div>

flask_inputfilter/Condition/ArrayLengthEqualCondition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Any, Dict
22

3-
from .BaseCondition import BaseCondition
3+
from flask_inputfilter.Condition.BaseCondition import BaseCondition
44

55

66
class ArrayLengthEqualCondition(BaseCondition):

0 commit comments

Comments
 (0)