taskpaper
Taskpaper parser in JavaScript
Last updated 3 years ago by rstacruz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install taskpaper 
SYNC missed versions from official npm registry.

taskpaper.js

Taskpaper parser in JavaScript

Parses files in Taskpaper format, a very simple hierarchal note-taking format.

Version 1:

    This file is in TaskPaper format.
    Tabs are used to indent.
    Each task begins with a "- ".
    Projects end with a ":".
    Tags are in the format "@tag_name" or "@tag(value)".
    All other lines (such as these) are considered as notes,
    and are to be ignored.

    - User signup
        - Register for an account
        - Log in @done
        - Forget password

    - Manage users
        - Create users @in_progress
        - Delete users @priority(1)
        - User profile page @40%

    - Blog
        - Creating new posts @done
        - Comments @done
        - Moderating comments @done

Installation

Install me via npm or yarn.

npm install taskpaper
yarn add --exact taskpaper

Usage

Use me via require('taskpaper/es5').

const parse = require('taskpaper/es5')
const output = parse('Hello:\n  - world')
console.log(output)
// Output:
{ type: 'document',
  children: [
   { type: 'project',
     value: 'Hello',
     children: [
       { type: 'task',
         value: 'world' } ] } ] }

For the modern ES2016+ version (require Node 6+), just use require('taskpaper').

AST format

It returns a Node, which is an object. A Node has these attributes:

Attribute Type Description D N P T
type String Either document, note, task, or project
value String The text in the project, task, or note
children Node[] An array of nodes
tags String[] List of tags
depth Number Depth in the tree
index Object Where the node is in the format of {line, column}

Thanks

taskpaper.js © 2016+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).

ricostacruz.com  ·  GitHub @rstacruz  ·  Twitter @rstacruz

Current Tags

  • 1.3.0                                ...           latest (3 years ago)

7 Versions

  • 1.3.0                                ...           3 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 3
Last Month 0
Dependencies (3)
Dev Dependencies (3)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |