Markdown entry form

As I know, markdown is a "simplified" version of html. It is easy to use and read. But I ran into the problem of creating an input form.

Can anyone suggest if there are any methods for adding elements of the html input form in the markdown method? I searched, but cannot find a satisfied solution. Any suggestions are welcome. Thanks.

+9
html-form markdown
source share
6 answers

Just use as html

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

So, you will have an input field in your markdown.

+9
source share

Not. Markdown is not a "simplified version of html" - it is a native markup language that is displayed in html (or tex or in many others) and which allows using built-in unprocessed fragments of the target language.

Having said that, this does not mean that people have not expanded it to support such things. It has been added to the javascript wmd based markup editor - see here .

+5
source share

Github has an open source project that does this in JavaScript:

https://github.com/justinmc/markdown-html-form

+2
source share

In the future, I am working on a PHP solution that extends Michelf Markdown for PHP and currently supports simple <input> and <textarea> elements. See https://github.com/rbnvrw/markdown-forms and feel free to contribute.

+1
source share

If you are looking for simplified markup syntax, but you need the power of html, you can 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/

+1
source share

There is a GitHub project that has a JavaScript editor that has an extended markdown that does what you want. https://github.com/brikis98/wmd . If you are cloning a project, there is an example editor in the html file that you can run from a browser. Both HTML and visualized form elements are displayed.

Can generate the following form elements

Text box:

 name = ___ 

Radio buttons:

 sex = (x) male () female 

Checkboxes:

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

Dropdown (Select)

 city = {BOS, SFO, (NYC)} 

Required fields

  zip code* = ___[50] 

Was it based on a Wiki or Markdown-like syntax for simple forms?

0
source share

All Articles