0.0.3 • Published 4 years ago
blocko-editor v0.0.3
Blocko
Blocko is a block-based WYSIWYG editor written in ClojureScript and compiled to JavaScript. Currently, Blocko is not yet production ready, so use at your own risk.

Install
NPM
- Run:
npm i blocko-editor - Import it:
import blocko from 'blocko';
Browser
- Download the latest release
- Include
blocko.cssandblocko.jsin your HTML
Usage
blocko.core.init({
container: '#editor',
initialContent: [],
onChange: (content) => {
// store `content` in your database here.
}
});API
container: any JS element that can be targeted viaquerySelectorinitialContent: a JS or JSON object representing the dataonChange: a callback function called when content changes
Development
To develop Blocko simply run ./build.sh dev, which will then compile to public/js/blocko.js a development version of Blocko that also auto-reloads as you make changes. After that is done, open public/index.html in your browser and have fun!
Once you're done with development and want to get production version, then:
- To get the browser production build, run
./build.sh release-browserand check insidedist/browserfor a brand newblocko.jsand ablocko.cssfile. To get the NPM production build, run
./build.sh release-npmand check insidedist/npmfor a brand newblocko.jsand ablocko.cssfile. Note that you have to import the CSS file in your project manually.