Skip to content

Commit

Permalink
feat: export named plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
webketje committed Mar 20, 2022
1 parent c90b996 commit b9aaa0f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ function isMarkdown(filePath) {
**/

/**
* Metalsmith plugin to convert markdown files.
* A Metalsmith plugin to render markdown files to HTML
* @param {Options} [options]
* @return {import('metalsmith').Plugin}
*/
const plugin = function (options) {
function initMarkdown(options) {
options = options || {}
const keys = options.keys || []

return function (files, metalsmith, done) {
return function markdown(files, metalsmith, done) {
setImmediate(done)
Object.keys(files).forEach(function (file) {
debug('checking file: %s', file)
Expand All @@ -50,4 +50,4 @@ const plugin = function (options) {
}
}

module.exports = plugin
module.exports = initMarkdown

0 comments on commit b9aaa0f

Please sign in to comment.