An open API service indexing awesome lists of open source software.

https://github.com/rtfb/pagedown-editor

This is a Node package for PageDown editor, intended to be used with Browserify.
https://github.com/rtfb/pagedown-editor

nodejs pagedown

Last synced: about 1 year ago
JSON representation

This is a Node package for PageDown editor, intended to be used with Browserify.

Awesome Lists containing this project

README

          

# Node package for PageDown Editor

The original [PageDown][pagedown-repo] repo only packages server-side code in
its [Node module][pagedown-module]. This package also packages the editor,
intended to be used along with [Browserify](http://browserify.org/).

## Installation

``` sh
$ npm install -g browserify
$ npm install pagedown-editor
```

## Usage

In some file, say, [sample.js](sample.js), create an entry point to the editor:

``` js
var editor = require("pagedown-editor");

function getPagedownEditor() {
return editor.getPagedownEditor();
}

global.window.getPagedownEditor = getPagedownEditor;
```

Then, during build time, browserify that file and copy the buttons and the
stylesheet:

``` sh
$ browserify sample.js -o bundle.js
$ cp node_modules/pagedown-editor/wmd-buttons.png static/
$ cp node_modules/pagedown-editor/pagedown.css static/
```

Finally, use the bundle like this in your html:

``` html

(function () {
getPagedownEditor().run();
})();

```

For your convenience there's a [sample.html](sample.html) with all of the above
in one place. After installation it will work out of the box from within your
`node_modules` directory, just direct your browser to `file:////node_modules/pagedown-editor/sample.html`.

## License

MIT license, see [LICENSE.txt](LICENSE.txt).

[pagedown-repo]: https://github.com/StackExchange/pagedown
[pagedown-module]: https://www.npmjs.org/package/pagedown