https://github.com/osukaa/dogbane-parser
Transform Markdown into API Blueprint JSON
https://github.com/osukaa/dogbane-parser
Last synced: over 1 year ago
JSON representation
Transform Markdown into API Blueprint JSON
- Host: GitHub
- URL: https://github.com/osukaa/dogbane-parser
- Owner: osukaa
- Created: 2015-07-10T12:41:57.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-06T00:44:10.000Z (almost 11 years ago)
- Last Synced: 2025-02-07T12:14:49.104Z (over 1 year ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# onion
Onion is a module to convert markdown [API Blueprint](https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md) files into an abstract syntax tree.
## Usage
```javascript
var onion = require('onion');
onion.getAST('path/to/file', function (err, warnings, tree) {
});
```
Parameters
* `pathToFile` is the path to the markdown file to parse.
* `options` is an optional object (currently WIP)
* `callback` the callback with the following parameters
* `err` any error obtained while getting file or parsing it.
* `warnings` an array of the parser warnings as occurred during the parsing
* `tree` the abstract syntax tree (AST) of the parsed blueprint. The structure is [here](https://github.com/apiaryio/api-blueprint-ast#example-json-serialization).