Skip to content

Commit 3802445

Browse files
committed
Merge pull request #24 from LeanderCS/23
23 | Add documentary
2 parents 291707f + a4d0aa6 commit 3802445

File tree

98 files changed

+1097
-501
lines changed

Some content is hidden

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

98 files changed

+1097
-501
lines changed

.github/workflows/deploy-docs.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy Sphinx Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
environment: github-pages
17+
18+
steps:
19+
- name: Checkout Repository
20+
uses: actions/checkout@v3
21+
22+
- name: Setup Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.x'
26+
27+
- name: Install Dependencies
28+
run: |
29+
pip install sphinx sphinx_rtd_theme
30+
31+
- name: Build Documentation
32+
run: |
33+
sphinx-build -b html docs/ _build
34+
35+
- name: Upload artifacts
36+
uses: actions/upload-pages-artifact@v3
37+
with:
38+
path: _build
39+
name: github-pages
40+
41+
- name: Deploy to GitHub Pages
42+
uses: actions/deploy-pages@v4
43+
with:
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
artifact_name: github-pages
46+
preview: false

.github/workflows/test_env.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: actions/cache@v4
1919
with:
2020
path: /tmp/.buildx-cache
21-
key: ${{ runner.os }}-docker-flask-inputfilter-env-${{ hashFiles('Dockerfile') }}
21+
key: ${{ runner.os }}-docker-flask-inputfilter-env-${{ hashFiles('env_configs/Dockerfile') }}
2222
restore-keys: |
2323
${{ runner.os }}-docker-flask-inputfilter-env-
2424

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,4 @@ cython_debug/
157157
.idea/
158158
.vscode/
159159
.DS_Store
160+
_build

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: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
flask-inputfilter
2-
==================================
2+
=================
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+
Thank you for using `flask-inputfilter`!
9+
========================================
10+
11+
Thank you for using ``flask-inputfilter``!
12+
If you have any questions or suggestions, please feel free to open an issue on GitHub `here <https://github.com/LeanderCS/flask-inputfilter>`_.
13+
If you don't want to miss any updates, please star the repository.
14+
This will help me to understand how many people are interested in this project.
15+
16+
========================================
17+
818
:Test Status:
919

1020
.. image:: https://img.shields.io/github/actions/workflow/status/LeanderCS/flask-inputfilter/test.yaml?branch=main&style=flat-square&label=Github%20Actions
@@ -37,10 +47,10 @@ Installation
3747
Quickstart
3848
==========
3949

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

43-
There are numerous filters and validators available, but you can also create your `own <CREATE_OWN.md>`_.
53+
There are numerous filters and validators available, but you can also create your `own <https://leandercs.github.io/flask-inputfilter/guides/create_own.html>`_.
4454

4555
Definition
4656
----------
@@ -92,8 +102,8 @@ Definition
92102
Usage
93103
-----
94104

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`.
105+
To use the ``InputFilter`` class, call the ``validate`` method on the class instance.
106+
After calling ``validate``, the validated data will be available in ``g.validated_data``.
97107
If the data is invalid, a 400 response with an error message will be returned.
98108

99109
.. code-block:: python
@@ -112,33 +122,11 @@ If the data is invalid, a 400 response with an error message will be returned.
112122
id = data.get('id')
113123
zipcode = data.get('zipcode')
114124
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.
132125
133-
Default
134-
-------
135126
136-
The `default` option allows you to specify a default value to use if the field is not
137-
present in the input data.
127+
See also
128+
========
138129

139-
Fallback
140-
--------
130+
For further instructions please view the documentary `Here <https://github.com/LeanderCS/flask-inputfilter>`_.
131+
For ideas, suggestions or questions, please open an issue on GitHub `here <https://github.com/LeanderCS/flask-inputfilter>`_.
141132

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.

0 commit comments

Comments
 (0)