0.0.11 • Published 10 years ago
markdown-editor-mw v0.0.11
markdown-editor-mw
Lightweight middleware Markdown editor. Can be used as a very lightweight wiki tool. Has an editor and an index of all the pages. Currently assumes usage of express with jade for views. You can also pass in options of middleware functions to protect routes such as read or write. All .md files will be written to the path that the express uses for the route, in this case /wiki.
##Install
npm install markdown-editor-mw##Setup with Node.js Module is used as a middleware with express routing.
var editor = require('markdown-editor-mw');
app.use('/wiki',editor.init({
'view':'index'
});Example index.jade Jade file:
h2 markdow-editor-mw
div
include ../node_modules/markdown-editor-mw/views/markdown-editor-mw.jadeCurrent options to the init function are:
dir, the location to store the.mdfilesreadAuthmiddleware function to use to allow read of files, default is everyone readswriteAuthmiddleware function to use to allow write/edit files, default is everyone readsviewpass the name of the view that includes themarkdown-editor-mw.jadefile
##How To
- To create a new file use the
/wiki/[FILE]/edit - To edit a file
/wiki/[FILE]/edit