formdown is a markdown inspired markup language for html forms. It is based on the proposed markup on stackoverflow.
The tests (incomplete) can be run by typing:
nosetests
To install it in your Python installation run:
python setup.py installUsing the specification as defined below, we can generate the forms.
text = _____gender = (X) Male () Femalechecklist = [x] item 1 [] item 2 [] item 3textbox = [[]]selection = {item 1, (item 2), item 3}date:datepicker = ________
print formdown.parse_form("name=____\ndate:datepicker=_____")Output:
<p><label>Name</label><input type="text" name="name" id="name" /></p>
<p><label>Date</label><input type="text" name="date" id="date" class="datepicker"/></p>
<p><input type="submit" value="Submit"></p>To use this with datepicker, simply follow the information contained on the homepage. Remember to change the script since "datepicker" is not an id but a class in formdown.
i.e.
$(function() {
$( ".datepicker" ).datepicker();
});Code and documentation copyright 2014 Chapman Siu. Code released under the MIT license.