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.
- Host: GitHub
- URL: https://github.com/rtfb/pagedown-editor
- Owner: rtfb
- License: other
- Created: 2014-05-01T09:17:47.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2018-02-25T13:10:41.000Z (over 8 years ago)
- Last Synced: 2025-04-11T04:03:36.240Z (about 1 year ago)
- Topics: nodejs, pagedown
- Language: JavaScript
- Size: 69.3 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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