0.0.5 • Published 10 years ago

ngdoc-parser v0.0.5

Weekly downloads
4
License
WTFPL
Repository
github
Last release
10 years ago

ngdoc-parser NPM version

Get the ngdoc data form you source comments

Extract all the ngdoc data form your sources to a big json.

Install

$ npm install --save-dev ngdoc-parser

Usage

var fs = require('vinyl-fs');
var path = require('path');
var through = require('through2');

var ngdocParser = require('ngdoc-parser');

fs.src('./src/*.js')
  .pipe(ngdocParser())
  .pipe(through.obj(function(file, e, callback){
    file.path = path.join(file.base, 'ngdoc-rawdata.json');
    callback(null, file);
  }))
  .pipe(fs.dest('./out'));

Output example

[ // Array of ngdoc comments
  {
    "ngdoc": "directive",
    "name": "ngRepeat",
    "description": "The `ngRepeat` directive instantiates a template once per item from a collection. [...]",
    "animations": "[...]",
    "element": "ANY",
    "scope": "",
    "priority": "1000",
    "params": [
      {
        "type": {
          "typeExpression": "repeat_expression",
          "type": {"type": "NameExpression", "name": "repeat_expression"},
          "typeList": ["repeat_expression"]
        },
        "name": {"name": "ngRepeat"},
        "description": "The expression indicating how to enumerate a collection. [...]"
      }
    ]
  },
  // ...
]

API

ngdocParser()

TODO

Demo

npm run demo

demo result

License

Copyright © 2014 Douglas Duteil <douglasduteil@gmail.com>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the LICENCE file for more details.
0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago