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.
npm i blocko-editor
import blocko from 'blocko';
blocko.css
and blocko.js
in your HTMLblocko.core.init({
container: '#editor',
initialContent: [],
onChange: (content) => {
// store `content` in your database here.
}
});
container
: any JS element that can be targeted via querySelector
initialContent
: a JS or JSON object representing the dataonChange
: a callback function called when content changesTo 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:
./build.sh release-browser
and check inside dist/browser
for a brand new blocko.js
and a blocko.css
file../build.sh release-npm
and check inside dist/npm
for a brand new blocko.js
and a blocko.css
file. Note that you have to import the CSS file in your project manually.Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close