qsl

1.1.1 • Public • Published

qsl.js

Build Status

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.

Usage

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
//   }
// ];

Contributors

License

Released under Apache 2.0 license.

Package Sidebar

Install

npm i qsl

Weekly Downloads

1

Version

1.1.1

License

Apache 2.0

Last publish

Collaborators