remark plugin to compile Markdown to plain text.
$ npm install remark-plain-text
var toPlainText = require( 'remark-plain-text' );
Compiles Markdown to plain text.
var remark = require( 'remark' );
remark.use( toPlainText );
var fs = require( 'fs' );
var path = require( 'path' );
var remark = require( 'remark' );
var toPlainText = require( 'remark-plain-text' );
var fpath;
var opts;
var file;
var doc;
// Load a Markdown file...
fpath = path.join( __dirname, 'fixtures/input.md' );
opts = {
'encoding': 'utf8'
};
file = fs.readFileSync( fpath, opts );
// Compile the Markdown file to plain text:
doc = remark.use( toPlainText ).process( file );
// Write the file to disk...
fpath = path.join( __dirname, 'fixtures/output.md' );
fs.writeFileSync( fpath, doc, opts );
To run the example code from the top-level application directory,
$ node ./examples/index.js
This repository uses tape for unit tests. To run the tests, execute the following command in the top-level application directory:
$ make test
All new feature development should have corresponding unit tests to validate correct functionality.
This repository uses Istanbul as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
$ make test-cov
Istanbul creates a ./reports/coverage
directory. To access an HTML version of the report,
$ make view-cov
Copyright © 2016. Athan Reines.