Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 1.19 KB

.verb.md

File metadata and controls

33 lines (22 loc) · 1.19 KB

This is a plugin for [breakdance][], the HTML-to-markdown converter.

What does this do?

Moves URLs to the bottom of the rendered markdown document, and replaces them with numbered "placeholder" reference links.

This has both advantages and disadvantages, depending on your needs.

  • advantage: this can make the markdown more readable
  • disadvantage: the downside is that the "placeholder" URLs are numbered, so it won't be immediately clear to readers what the actual URL is until they visit the corresponding reference link at the bottom of the document.

Usage

Use breakdance's .before method to register the plugin.

var Breakdance = require('breakdance');

// IMPORTANT! you must enable reflinks. You can do 
// that here or on the `.render` method
var breakdance = new Breakdance({reflinks: true});
var reflinks = require('{%= name %}');

// this adds a 
breakdance.before('eos', reflinks());

// after registering the plugin, use the `.render` method
// to convert HTML to markdown
var markdown = breakdance.render(/* html string */);
console.log(markdown);

Visit the breakdance documentation for more information about using and customizing breakdance.