Askdown — forms, written like Markdown

3 min read Original article ↗

A plain-text format for forms.

Write questions the way you'd write a list, get a form with pages, branching and validation, and host it or render it anywhere.

No account needed to try it.

Everything a form needs, in text

Parity with the usual form builders, without the drag and drop, unless you want it.

An open spec

Askdown is a documented, versioned format under CC BY 4.0. Anyone can implement it, and .ask files read fine as plain text.

JSON and a JSON Schema

Every document maps to a canonical JSON model, described by a published JSON Schema. Parse text, or generate forms from your own tools.

The question types you expect

Short and long text, email, URL, phone numbers, number, date, time, single and multiple choice, dropdowns, scales, ratings, rankings, grids, file uploads and addresses, with validation attributes.

Pages and branching

Split a form into pages and jump between them from an answer, so respondents only see what applies to them.

Hosted forms and responses

Sign in with an email link, publish a form at its own URL, and collect responses with summaries and a CSV export.

Reference libraries

@askdown/core parses, serializes and validates with zero dependencies. @askdown/html renders accessible HTML and adds paging with a small vanilla runtime.

The whole syntax fits on a napkin

These four snippets cover most forms. The spec has the rest.

Questions

? Full name *
___

? Tell us more
___
___

? Email {#email}
> Help text under the label
[email]

? starts a question, * makes it required, {#id} pins the id. ___ is short text, two of them a paragraph.

Choices

? Attending?
- ( ) Yes
- (x) Not sure
- ( ) No -> #bye

? Toppings
- [ ] Cheese
- [ ] Other: ___

? Country
[select]
- Netherlands
- Canada

( ) is single choice, [ ] multiple, (x) a default, -> #page a jump, and "Other: ___" a free-text option.

Types and attributes

? Age
[number min=0 max=130]

? Score
[scale 0..10 "Low" "High"]

? Rate it
[rating 5]

? Resume
[file accept=".pdf" maxsize=10MB]

? Rank these
1. Speed
2. Price
3. Support

text, paragraph, email, url, phone, number, date, time, radio, checkbox, select, scale, rating, grid, checkbox-grid, file, address, ranking.

Pages, grids and settings

---
title: Survey
confirmation: Thanks!
---

? Rate each session
[grid]
|          | Poor | Great |
| Keynote  |
| Workshop |

--- {#page-2}

# Second page

-> submit

Front matter sets the title and settings. --- starts a page, # titles it, and -> jumps somewhere else.

Start with an example

The builder shows a live preview, a visual editor and the JSON side by side.