Skip to content

ToxicTree/batch-showdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

batch-showdown Version

A small node.js script that takes a folder path to markdown files and then generate html files using showdown.

See configuration on how to include css and js into the generated files.

When done, all markdown files will be at the destination as .html files and a reference can be found at tree.json (in both source and destination folders)

Install

npm install batch-showdown -g

Usage

batch-showdown <source_folder> <destination_folder> [configuration.js] [verbose?]

# Example
batch-showdown src/docs public/docs

In another project?

Install and add it to dependencies

npm install batch-showdown --save

Make a script in package.json

"scripts":{
  "docs": "batch-showdown src/docs public/docs"
}

Run script from project folder

npm run docs

Configure (optional)

Pass a configuration (.js) file as third argument. Configuration looks like this:

module.exports = {
  css: ["path/to/some/style.css"],
  js: ["path/to/some/script.js"],
  onload: "runScript();"
}