rehype-autolink-headings
Advanced tools
Comparing version 1.0.0 to 2.0.0
'use strict'; | ||
/* Dependencies. */ | ||
var xtend = require('xtend'); | ||
@@ -9,6 +8,4 @@ var visit = require('unist-util-visit'); | ||
/* Expose. */ | ||
module.exports = autolink; | ||
/* Constants. */ | ||
var headings = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; | ||
@@ -22,4 +19,3 @@ var methods = {prepend: 'unshift', append: 'push'}; | ||
/* Attacher - Add links to headings. */ | ||
function autolink(processor, options) { | ||
function autolink(options) { | ||
var settings = options || {}; | ||
@@ -26,0 +22,0 @@ var props = settings.properties; |
{ | ||
"name": "rehype-autolink-headings", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Add links to headings in HTML", | ||
@@ -30,10 +30,10 @@ "license": "MIT", | ||
"bail": "^1.0.1", | ||
"browserify": "^13.0.0", | ||
"browserify": "^14.1.0", | ||
"esmangle": "^1.0.0", | ||
"is-hidden": "^1.0.1", | ||
"negate": "^1.0.0", | ||
"nyc": "^8.3.1", | ||
"rehype": "^3.0.0", | ||
"remark-cli": "^2.0.0", | ||
"remark-preset-wooorm": "^1.0.0", | ||
"nyc": "^10.0.0", | ||
"rehype": "^4.0.0", | ||
"remark-cli": "^3.0.0", | ||
"remark-preset-wooorm": "^2.0.0", | ||
"tape": "^4.0.0", | ||
@@ -44,3 +44,3 @@ "to-vfile": "^2.1.1", | ||
"scripts": { | ||
"build-md": "remark . --quiet --frail", | ||
"build-md": "remark . -qfo", | ||
"build-bundle": "browserify index.js --bare -s rehypeAutolinkHeadings > rehype-autolink-headings.js", | ||
@@ -67,5 +67,4 @@ "build-mangle": "esmangle rehype-autolink-headings.js > rehype-autolink-headings.min.js", | ||
"remarkConfig": { | ||
"output": true, | ||
"presets": "wooorm" | ||
"plugins": ["preset-wooorm"] | ||
} | ||
} |
@@ -35,6 +35,10 @@ # rehype-autolink-headings [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] | ||
rehype().use(slug).use(link).process(doc, {fragment: true}, function (err, file) { | ||
if (err) throw err; | ||
console.log(String(file)); | ||
}); | ||
rehype() | ||
.data('settings', {fragment: true}) | ||
.use(slug) | ||
.use(link) | ||
.process(doc, function (err, file) { | ||
if (err) throw err; | ||
console.log(String(file)); | ||
}); | ||
``` | ||
@@ -41,0 +45,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
100
7218
52