0.1.4 • Published 7 years ago
light-markdown v0.1.4
lightMarkdown
Javascript library that helps you convert simplified markdown (like used in Slack messages) to HTML
Installation
Download tarball
You can download the latest release tarball directly from releases
Bower
bower install light-markdownnpm (server-side)
npm install light-markdownCDN
You can also use one of several CDNs available:
github CDN
https://cdn.rawgit.com/Tonkean/lightMarkdown/<version tag>/dist/light-markdown.min.js
Quick Example
Node
var light-markdown = require('light-markdown');
var text = 'This should be *bold*';
var html = light-markdown.toHtml(text);Browser
var text = 'This should be *bold*';
var html = light-markdown.toHtml(text);Output
Both examples should output...
<p>This should be <b>bold</b></p>Tests
A suite of tests is available which require node.js. Once node is installed, run the following command from the project root to install the dependencies:
npm installOnce installed the tests can be run from the project root using:
npm testNew test cases can easily be added. Create a light markdown file (ending in .lmd) which contains the markdown to test. Create a .html file of the exact same name. It will automatically be tested when the tests are executed with mocha.