flask-mdform
An extension for Flask to generate Flask-WTF parsing Markdown based document using mdforms. Checkout the syntax in the mdform page.
Installation
pip install flask-mdform
Usage
Use it like this to create a WTForm compatible template:
or use it like this to create a WTForm compatible template that uses Bootstrap4.
>>> from flask_mdform import Markdown, FormExtension, flask_wtf_bs4
>>> md = Markdown(extensions = [FormExtension(formatter=flask_wtf_bs4("jQuery", "wtf."))])
>>> html = md.convert(text) # this is the jinja template with Flask WTForm and BS4
>>> form_dict = md.Form # this is the definition dict
Here, the two arguments in the formatter can be use it to customize it. “jQuery” is the name of the jQuery variable, “wtf.” is the prefix where WTForm bootstrap form_field function is located.
Other functions
use_mdform: decorator to be used in a flask route to parse, display, load and store form and its values.
form_to_dict: iterates through a filled form and returns a dictionary with the values in a json compatible format.
dict_to_formdict: iterates through a dict, parsing each value using the spec defined in form_cls.
from_mdfile: generates form metadata, template, form from markdown file.
from_mdstr: generates form metadata, template, form from markdown string.
See AUTHORS for a list of the maintainers.
To review an ordered list of notable changes for each version of a project, see CHANGES
Metadata
Release files for Flask-mdform 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Flask-mdform-0.1.1.tar.gz | 16.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Flask_mdform-0.1.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 20.5 kB
Release files / Flask-mdform-0.1.1.tar.gz
| Download URL | Flask-mdform-0.1.1.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b33208e1e72e62f4ccd00f73be9463da0d877e7dde63b345930ab80fd20ffe1
|
|
BLAKE2b-256 checksum How to use checksums |
c6a4b32687d28235000197af3cb0fdc9b8cd19d4de313a93ece198b8cb9003a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.2
|
Release files / Flask_mdform-0.1.1-py2.py3-none-any.whl
| Download URL | Flask_mdform-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
4720f69d69a526e99eaa49e69d0b3ad63452b4c678c9cb56de4553b5287ef2a4
|
|
BLAKE2b-256 checksum How to use checksums |
1893b0a76bca8a9ecfacc84e499651895e6b663293fe8ec68934ac36223e4429
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.2
|