Data
Todo
- Form with arrayzed fields group_by: panel
- Form for forms
- Form for tables (show table if present)
- Generators
Others
- import or update data file ask
ower/repository
and check 404 - json form file already present, live values (edit function)
- delete wrong csv lines
TABLES
Input
Render a form to create or edit a data file, or perform automatic functions.
Fields and destination are passed with a data file or in the front matter.
include.class
: class added to output element.include.form
: front-matter or data file, default topage.form
.{% include widgets/input.html form=page.form %}
include.function
: javascript function.{% include widgets/input.html function='a/b=c/d' %}
Forms schema
file_name
:file_extension
:file_path
:file_overwrite
:file_append
:
fields
:type
: text, hidden, email, textarea, number, boolean, color, date, datetime, select, select multiple, radio, ref, random, roll (csv)options
: required, disabled, placeholder
Form bottom contains a message box for the future
<div data-input="message" role='status'></div>
- Form fields (value = default value)
hidden
value
stringtimestamp
booleanslug
field
text
value
stringplaceholder
stringtimestamp
booleanrequired
booleandisabled
booleanslug
fieldautocomplete
Quoted (on/off are yaml) string (on/off/space-separated-tokens)
number
value
stringmin
stringmax
stringstep
stringplaceholder
stringtimestamp
booleanrequired
booleandisabled
booleanpool
Math expression with property names that are valid numbers es.2*items+fee
range
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/rangevalue
stringmin
string default 0max
string default 100step
string default 1disabled
boolean
roll
dice
dice format,<num>
d<sides>
±<mod>
es.3d6+2
csv
table path in _data/ es.gfl/race.csv
email
value
stringplaceholder
stringautocomplete
string (on/off/space-separated-tokens)required
booleandisabled
boolean
select
value
stringmultiple
booleanrequired
booleandisabled
boolean
radio
(like select but can include descriptions)checkbox
(like select multiple but can include descriptions)textarea
placeholder
stringrequired
booleandisabled
boolean
color
value
stringrequired
booleandisabled
boolean
date
value
date asYYYY-MM-DD
min
date asYYYY-MM-DD
max
date asYYYY-MM-DD
step
days of step, default 1disabled
boolean
datetime
value
min
date asYYYY-MM-DDTHH:mm
max
date asYYYY-MM-DDTHH:mm
step
seconds of step, default 60 (1 min)disabled
boolean
- Custom fields
object
- subfields with type ecc. (recursive)
Exposed api
# From remote:
# https://{owner}/github.com/{repository}/assets/data.json
$.getJSON('/assets/data.json').done (data) -> console.log data