1.0.0 • Published 7 years ago
transitionsjs v1.0.0
transitions.js
--
Convert Markdown to HTML
Get Started
- Install Transitions
npm install --save transitionsjs
- Import It ES5
var transitions = require('transitionsjs');
ES6
import transitions from 'transitionsjs';
- Use It Pass it a file
transitions(__dirname + '/hello.md');
// returns a HTML string of the converted
// markdown that is in the file
Pass it a string
transitions('Hello, I\'m a *formatted* __string__!');
// returns the HTML string below
<p>Hello, I’m a <em>formatted</em> <strong>string</strong>!</p>
BONUS
What makes it cool? Transitions lets you include <div>
tags!
How do you do that? Simply place the delimiter ==$$==
within your markdown and the content before and after the delimiter will be placed in their own <div>
s.
For example: This line
transitions('Alpha==$$==Beta');
returns
<div><p>Alpha</p></div><div><p>Beta</p></div>
1.0.0
7 years ago