Input form in markdown

There's a github project that has a javascript editor which has an extended markdown that does what you want. https://github.com/brikis98/wmd. If you clone the project, there's an example editor in an html file that you can launch from your browser. Both html and rendered form elements are displayed.

It can generate the following form elements

Text box:

name = ___

Radio buttons:

sex = (x) male () female

Check boxes:

phones = [] Android [x] iPhone [x] Blackberry

Drop down (Select)

city = {BOS, SFO, (NYC)}

Required fields

 zip code* = ___[50]

This was based on Wiki or Markdown-like syntax for simple forms?


Just use html

<input type="text" id="name" name="name"/>

You will get a input box in your markdown.


No. Markdown is not a 'simplified version of html' - it's its own markup language that renders to html (or tex or many others) and which allows inline raw snippets of the target language.

Having said that, that doesn't mean people haven't extended it to support such things. It has been added to the wmd javascript based markdown editor - see here


If you are looking for a simplified markup syntax, but need the power of html, you might want to consider Jade instead of Markdown:

h1 User Information

form(action='/save')
  input(name='name')
  input(name='email')
  input(type='submit', value='Save')

http://jade-lang.com/

Tags:

Forms

Markdown