A Metalsmith plugin to use markdown content within html tags via
Based on idea and code by Paul Irish. His implementation is currently used in reveal.js, a presentation framework. Likewise, this metalsmith plugin might become handy, if you want to compile these presentations down to HTML(during generation time with metalsmith.
Extracted from majodev.github.io.
As part the my note "Extracting libs from a node.js project: Publishing my metalsmith plugins".
npm install --save metalsmith-data-markdown
var Metalsmith = ;var datamarkdown = ;// ... state when html files are available// ...
Should also work in similar fashion with the
datamarkdown accepts an hash to provide a few customization options.
Object: Options you want to hand over to marked. Will get invoked via
data-markdown attributes should be removed from tags after they were processed.
Full example with options set
Here's how this will work with some marked options set + full input and output.
var Metalsmith = ;var headingsidentifier = ;// ... state when html files are available// ...
html example input
<!-- ... -->### WLAN Security Revisited (paper)#### Rogue AP, Deauthentication Attack and Portal via PwnSTAR in 2 Minutespublished on June 2012FH JOANNEUM information management master*"Creating a Rogue Access Point with redirecting web portal and hijacking open wifi users via de-authentication attack."*<!-- ... -->
html example output
WLAN Security Revisited (paper)Rogue AP, Deauthentication Attack and Portal via PwnSTAR in 2 Minutespublished on June 2012FH JOANNEUM information management master“Creating a Rogue Access Point with redirecting web portal and hijacking open wifi users via de-authentication attack.”
File an issue or fork 'n' fix and send a pull request.
(c) 2014 Mario Ranftl