Creates markdown Abstract Syntax Tree
npm i -S markdownscript
'use strict'
var m = require('markdownscript')
var heading = m.heading
var paragraph = m.paragraph
var ast = heading({ depth: 1 }, [
paragraph(['Hello world!']),
])
console.log(JSON.stringify(ast, null, 2))
//> {
// "type": "heading",
// "children": [
// {
// "type": "paragraph",
// "children": [
// {
// "type": "text",
// "value": "Hello world!"
// }
// ]
// }
// ],
// "depth": 1
// }
m(type, [attributes], [children])
- create a node
console.log(m('link', { url: 'http://google.com' }, ['Google']))
//> { type: 'link',
// children: [ { type: 'text', value: 'Google' } ],
// url: 'http://google.com' }
m.[type]([attributes], [children])
- create a node
var code = m.code
console.log(code({ lang: 'js' }, ['void 0']))
//> { type: 'code',
// children: [ { type: 'text', value: 'void 0' } ],
// lang: 'js' }
m.h[depth]([attributes], [children])
- create a heading node of the specified depth
var h3 = m.h3
console.log(h3([paragraph(['Foo bar'])]))
//> { type: 'heading',
// children: [ { type: 'paragraph', children: [Object] } ],
// depth: 3 }
- babel-runtime: babel selfContained runtime
- babel-cli: Babel command line.
- babel-plugin-add-module-exports: Fix babel/babel#2212
- babel-plugin-transform-runtime: Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals
- babel-preset-es2015: Babel preset for all es2015 plugins.
- babel-preset-stage-0: Babel preset for stage 0 plugins
- babel-register: babel require hook
- chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
- cz-conventional-changelog: Commitizen adapter following the conventional-changelog format.
- eslint: An AST-based pattern checker for JavaScript.
- eslint-config-standard: JavaScript Standard Style - ESLint Shareable Config
- eslint-plugin-promise: Enforce best practices for JavaScript promises
- eslint-plugin-standard: ESlint Plugin for the Standard Linter
- ghooks: Simple git hooks
- istanbul: Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests
- mocha: simple, flexible, fun test framework
- mos: A pluggable module that injects content into your markdown files via hidden JavaScript snippets
- semantic-release: automated semver compliant package publishing
- tonic-example: Tonic example generator
- validate-commit-msg: Script to validate a commit message follows the conventional changelog standard