kiss-docwriter

0.0.1 • Public • Published

node-kiss-docwriter

Keep It Simple, Stupid : Document Writer helper module

Getting started :

    npm install --save kiss-docwriter

Then :

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>My kiss documents</title>
    <link href="node_modules/kiss-docwriter/style.css" rel="stylesheet" />
    <link href="node_modules/kiss-docwriter/print.css" rel="stylesheet" media="print" />
    <script src="node_modules/kiss-docwriter/bundle.js"></script> 
    <script>
      document.addEventListener("DOMContentLoaded",function(){
        var docwriter = new Kiss([{"name":"My Content Name","path":"README.md"}]);
      });
    </script> 
  </head>
  <body>
  </body>
</html>

Tadam, you're all set.

Options

Enable syntax highlighting (with prismjs):

var opts = {
  renderer:{
    codespan: function(code){
      return "<blockquote>"+code+"</blockquote>";
    }
  },
  gfm:true,
  highlight:function(code,lang){
  if (!lang||!prism.languages[lang]) {
    lang = 'markup';
  }
  return prism.highlight(code, prism.languages[lang]);
  }
}
var docwriter = new Kiss([{"name":"My Content Name","path":"README.md"}],opts);

Don't forget to include prismjs' JS and CSS files.

Package Sidebar

Install

npm i kiss-docwriter

Weekly Downloads

1

Version

0.0.1

License

GPL-3.0

Last publish

Collaborators

  • klepthys