marked-token-tree
Build a tocken tree from marked tokens.
Instalation
npm install --dev marked-token-tree
Usage
Get the tree object
const tree = const source = ` # Main heading Main block text ## Section 1 Second level block text ### Section 1.1 Third level block text ### Section 1.2 Third level block text \```stylus .element color: black \``` \```css .element { color: #000; } \``` ## Section 2 Second level block text `; const output = ; console;
will output:
Walk the token tree
const fs = const tree = const source = fs source