0.1.1 • Published 10 years ago

adf v0.1.1

Weekly downloads
1
License
BSD-2-Clause
Repository
-
Last release
10 years ago

A Document Format

ADF is a simple structured file format, allowing you to create lists of items with properties.

Installation:

npm install adf

Usage:

var adfparse = require("adf");
var fileContent = // read a file
var ast = adfparse(fileContent);

Example:

Parsing this:

# meta = data
list header
    item text {prop=2,"dsa", "dsa"}

another list
    item text again {prop="more properties"}
    more items here {properties="are currently mandatory for every item"}

Will yield this:

{ meta: { meta: 'data' },
  items: 
   [ { header: 'list header',
       titles: 
        [ { name: 'item text',
            property: { type: 'prop', values: [ 2, 'dsa', 'dsa' ] } } ] },
     { header: 'another list',
       titles: 
        [ { name: 'item text again',
            property: { type: 'prop', values: [ 'more properties' ] } },
          { name: 'more items here',
            property: 
             { type: 'properties',
               values: [ 'are currently mandatory for every item' ] } } ] } ] }

There are also examples in the test directory.

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago