JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15030
  • Score
    100M100P100Q140660F
  • License MIT

Manipulate sections in a string of markdown.

Package Exports

  • sections

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sections) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

sections NPM version Build Status

Manipulate sections in a string of markdown.

Install

Install with npm:

$ npm i sections --save

Usage

This is meant to be fast and opinionated, and only works with ATX headings.

var sections = require('sections');

API

.parse

Parses sections in a string of markdown and returns an object with two properties:

  • sections: an array of markdown "sections", delimited by ATX headings,
  • result: the cumulative result of whatever is returned by the (optional) function that is passed as the second argument.

Params

  • string {String}
  • fn {Function}
  • returns {Object}

.format

Format sections. By default, if no filter function is passed, this:

  • filters out empty sections
  • fixes whitespace between sections

Params

  • str {String}: Markdown string
  • fn {Function}: optional filter function
  • returns {String}

Generate docs

Generate readme and API documentation with verb:

$ npm i -d && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2016 Jon Schlinkert Released under the MIT license.


This file was generated by verb, v0.9.0, on February 15, 2016.