A metalsmith plugin to convert a property value from markdown to HTML.
Useful if you have other markdown data to convert in a file besides contents.
Requires metalsmith-collections plugin to work.
This plugin uses marked to make markdown conversions.
Install it via NPM:
$ npm install metalsmith-propdownconst metalsmith = require('metalsmith');
const collections = require('metalsmith-collections');
const propdown = require('metalsmith-propdown');
metalsmith('working/dir')
.use(collections({posts: '*.html'}))
.use(propdown({ // make sure it comes after collections
collection: 'posts',
property: 'excerpt'
}))Will convert content of each excerpt property in posts collection files.
Type: String (Required)
Name of the configured metalsmith-collection to process files
from (see the usage example above).
Type: String (Required)
Property in which value must be converted from markdown to HTML.
Type: Object (Optional)
Object containing markdown options passed to marked.
Fork this repo, install the dependecies, run the tests, submit a pull request.
$ cd metalsmith-propdown
$ npm install
$ grunt testYou can run any grunt task just with npm scripts: npm run grunt -- <taskname>.
The following command is the same as grunt test:
$ npm run grunt -- testYou can keep the tests running automaticaly every time you make any change to
the code with dev workflow:
$ grunt dev
$ npm run grunt -- devAlways implement tests for whatever you're adding to the project. Thanks!
MIT © Almir Filho