QSL parser
QSL is an indentation-significant, outliner-like markup language used to define questionnaires.
This project is a JavaScript implementation of a QSL parser.
qsl.js
exposes parse
the takes a raw QSL document and returns a
array-object representation.
format
takes a parsed document and a section name and returns a formatted
representation of the given section.
# bands.qsl
Favourite bands survey
defaults
required
section execution order
bands
bands:
First gig?
How many gigs?
integer
'use strict';
var qsl = require('qsl');
var parsed = qsl.parse(bandsQSL);
return qsl.format(parsed, 'bands');
// =>
// [
// {
// label: 'First gig?',
// name: 'first-gig',
// type: 'text',
// required: true
// },
// {
// label: 'How many gigs?',
// name: 'how-many-gigs',
// type: 'number',
// required: true
// }
// ];
- Johannes Wilm http://www.johanneswilm.org
- Tom Vincent https://tlvince.com
Released under Apache 2.0 license.