Skip to content

Commit c18e441

Browse files
committed
Update README.md
- Added some detail and corrected some markup - Added PyPi Badge
1 parent 8901ab7 commit c18e441

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
1+
[![PyPI version](https://badge.fury.io/py/django-materializecss-form.svg)](https://badge.fury.io/py/django-materializecss-form)
2+
13
# materialize-css-form
24
Materializecss for Django Form
35

46
A simple Django template tag to work with [Materializecss](http://materializecss.com/)
57

6-
7-
8-
9-
108
## Install
119

10+
From [PyPi](https://pypi.org/project/django-materializecss-form/):
1211

1312
```
1413
pip install django-materializecss-form
15-
1614
```
1715

16+
[From GitHub](https://github.com/kalwalkden/django-materializecss-form)
1817

19-
20-
[on pypi](https://pypi.python.org/pypi/django-materializecss-form)
21-
[on GitHub](https://github.com/kalwalkden/django-materializecss-form)
22-
23-
Add to INSTALLED_APPS:
18+
Add module to INSTALLED_APPS:
2419

2520
```
2621
INSTALLED_APPS = (
@@ -74,45 +69,54 @@ $(document).ready(function(){
7469

7570
## Usage
7671

77-
Use it like this, simple.
72+
Import the module simply like this:
7873

7974
```html
8075
{% load materializecss %}
8176
```
8277

8378
### Full form
8479

80+
Format a whole form:
81+
8582
```html
8683
{{ form|materializecss }}
8784
```
8885

8986
### Individual field
9087

88+
Format only a specific field:
89+
9190
```html
9291
{{ form.<field name>|materializecss }}
9392
```
9493

9594
### Custom size (default is 's12')
9695

96+
Apply custom sizes in grid ([see Materialize CSS documentation](https://materializecss.com/grid.html)):
9797
```html
9898
{{ form|materializecss:'m6' }}
9999
{{ form|materializecss:'custom_size=m6' }}
100100
```
101101

102102

103103
### Icons support
104+
104105
This is most useful for adding a descriptive icon when you are creating a custom layout by building the form one field at a time. Substitue FIELD_NAME below with one of the field names from your form.
106+
105107
```html
106108
{{ form.FIELD_NAME|materializecss:'s12 m6, icon=person' }}
107109
{{ form.FIELD_NAME|materializecss:'custom_size=s12 m6, icon=person' }}
108110
```
109111

110-
#### Opional icon sets
112+
#### Optional icon sets
113+
111114
If you're using optional icon sets you need to set `MATERIALIZECSS_ICON_SET` in your settings file:
112115

113116
```python
114117
MATERIALIZECSS_ICON_SET = 'fontawesome'
115118
```
119+
116120
Currently [Font Awesome](https://www.fontawesome.com/) and [GLYPHICONS](https://www.glyphicons.com) is supported, however you might need to modify your CSS for full support.
117121

118122
### Note about `DateTimeField`
@@ -147,15 +151,10 @@ DATETIME_INPUT_FORMATS += ["%Y-%m-%dT%H:%M:%S", "%Y-%m-%dT%H:%M"]
147151
- DateField
148152
- DateTimeField
149153

150-
151-
152154
## Inspired by
153155

154156
[django-bootstrap-form](https://github.com/tzangms/django-bootstrap-form)
155157

156158
## Originally Built By
157159

158-
Florent CLAPIÉ
159-
160-
[https://pypi.org/user/florent1933/] https://pypi.org/user/florent1933/
161-
160+
Florent CLAPIÉ ([PyPI](https://pypi.org/user/florent1933/))

0 commit comments

Comments
 (0)