@xmark/transform-wrap-headings
Convert flat markdown ast to nested html ast, support customization
Last updated 6 months ago by wangshijun .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @xmark/transform-wrap-headings 
SYNC missed versions from official npm registry.

@xmark/transform-wrap-headings

Wrap flat html tag list (from markdown ast) with section divs for different levels

Usage

const XMark = require('@xmark/core');
const TransformWrapHeadings = require('@xmark/transform-wrap-headings');

const xmark = XMark();

xmark.useTransform(TransformWrapHeadings, {
  parseAttributes: true,
  parseStyleAttributes: true,
  wrapperTag: 'section',
  enabledHeadings: ['h1'],
  wrapperClasses: {
    wrapper: 'section',
    modifier: x => `section--level${x}`,
  },
});

const markdown = '# heading 1';
const hast = xmark.toHAST(markdown);
const html = xmark.toHTML(markdown);

Current Tags

  • 0.24.0                                ...           latest (6 months ago)

21 Versions

  • 0.24.0                                ...           6 months ago
  • 0.23.1                                ...           8 months ago
  • 0.22.0                                ...           9 months ago
  • 0.21.0                                ...           9 months ago
  • 0.20.0                                ...           a year ago
  • 0.19.0                                ...           a year ago
  • 0.18.0                                ...           a year ago
  • 0.17.0                                ...           a year ago
  • 0.16.0                                ...           a year ago
  • 0.15.0                                ...           a year ago
  • 0.14.0                                ...           a year ago
  • 0.13.0                                ...           a year ago
  • 0.12.0                                ...           a year ago
  • 0.11.0                                ...           a year ago
  • 0.10.0                                ...           2 years ago
  • 0.9.1                                ...           2 years ago
  • 0.8.0                                ...           2 years ago
  • 0.7.0                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 13
Last Day 0
Last Week 5
Last Month 43
Dependencies (5)
Dev Dependencies (3)

Copyright 2014 - 2016 © taobao.org |