documeta
leverages object-metadata for documentation
Last updated 3 years ago by micimize .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install documeta 
SYNC missed versions from official npm registry.

Documeta

Native, js documentation library leveraging object-metadata

Note: this is currently a barebonese expirement. If you're looking for robust documentation tooling, I'd recommend documentation.js.

Usage:

import doc from 'documeta'

doc.get(doc)
/* =>
  es6 template string tag that expands into meta({ docstring }).
  If terminated with "meta:" on an othewise empty line,
  will instead return a function for accepting more metadata.
*/

const arrayify = doc`
  wraps defined non-array elements in an array,
  always returns an array.

  meta: `({
  examples: [
    {input: ['foo'], output: ['foo']},
    {input: 'foo', output: ['foo']},
    {input: undefined, output: []}
  ]
})(
  function arrayify(val){
    return Array.isArray(val) ? val : (val !== undefined ? [val] : [])
  }
)
doc.get(arrayify)
/* =>
  wraps defined non-array elements in an array,
  always returns an array.
*/

Current Tags

  • 0.0.1                                ...           latest (3 years ago)

1 Versions

  • 0.0.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |