A conversion utility for converting reStructuredText markup to markdown
JavaScript Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
man Refreshing changes: Aug 31, 2015
tests Refreshing changes: Aug 31, 2015
.gitignore
.jshintrc
CONTRIBUTING.md Adding contribution guidlines and jshint configruation. Mar 22, 2013
LICENSE
README.md
index.js
package.json Refreshing changes: Aug 31, 2015

README.md

rst2mdown

This is a utility for converting from reStructuredText mark-up to markdown mark-up.

Installation

The tool can be installed via npm:

$ npm install rst2mdown

Or you can download the .zip or .tar.gz, extract and use.

Testing

You can test the installation be using the test script from the root directory:

$ node test

Usage

You will require NodeJS installed. To take in a reStructuredText file and output a markdown one, you would run the following command from the root of the install:

$ bin/rst2mdown -i somefile.rst -o somefile.md

Also, the binary version also support stdin and stdout:

$ bin/rst2mdown < somefile.rst > somefile.md

And module supports both CommonJS and AMD loading. To load as CommonJS module under node:

var rst2mdown = require('rst2mdown');

var mdown = rst2mdown(someReStructuredText);

Or as an AMD module:

require(['rst2mdown'], function (rst2mdown) {
    var mdown = rst2mdown(someReStructuredText);
});

Converting from reStructuredText to markdown is not straight forward. Generally speaking, reStructuredText provides significantly more features than are supportable via markdown. Please refer to the Conversion Notes to understand how particular aspects of the conversion are handled.

License

This code is licensed under the New BSD License and is Copyright (c) 2012 Kitson P. Kelly.

Acknowledgement

This code is possible through documentation and concepts from other projects: