-
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for injecting plugins into remark(1)
Previously, there was support for injecting plugins by their name, but it was not possible to inject real functions into remark(3) through remark(1). This feature enables remark(1) users through the Node API to inject attachers (see **ATTACHER** in remarkplugin(3)), through a new `use` function exposed on the CLI object: ```js var CLI = require('remark/lib/cli/cli'); var engine = require('remark/lib/cli'); var html = require('remark-html'); var cli = new CLI({ 'files': 'readme.md' }).use(html); run(cli, function (err, success) { console.log('done!', err, 'successfully?', success); }); ``` Yields: ```txt readme.md: no issues found done! null successfully? true ``` In addition, it’s now possible to pass a `CLI` object (exposed from `lib/cli/cli`) directly into the engine (exposed from `lib/cli`).
- Loading branch information
Showing
2 changed files
with
63 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters