markdown-component
barebones component that offers a textarea as input for markdown formatted text, and a div that outputs the rendered markdown.
a markdown editing nanocomponent
Usage
var MarkdownComponent = var md = var component = md
API
// defaultvar markdownComponent = var md = var component = md
md.render
: String|Object
String
: (optional), markdown formatted stringObject
: (optional), options for the rendered elements
options object
} component: classes: 'classes for the containg div' textarea: classes: 'classes for the textarea element' div: classes: 'classes for the the output div' onDrop: `Function|Boolean` // Defualt: Adds markdown syntax for an image blob to the text editor, and renders the image in the output. // Implementing your own `onDrop` function will override the default onDrop function. // Setting `onDrop: false` will prevent the text editor from doing anything with file drag and drops.}
Example
var choo = var html = var css = var strftime = var MarkdownComponent = var app = if processenvNODE_ENV !== 'production' app app moduleexports = app { var time = var md = var component = md return html` `}
Install
With npm installed, run
$ npm install markdown-component
Todo
- Write tests
- Expand on documentation
- Explore if this is even a good idea