All Projects → askonomm → blocko

askonomm / blocko

Licence: other
A block-based WYSIWYG editor.

Programming Languages

clojure
4091 projects
HTML
75241 projects

Projects that are alternatives of or similar to blocko

wysiwyg-editor-python-sdk
Python SDK to ease the integration of Froala WYSIWYG Editor on server side.
Stars: ✭ 20 (-53.49%)
Mutual labels:  wysiwyg
ray
HTML-powered text editor for creating and organizing personal notes.
Stars: ✭ 115 (+167.44%)
Mutual labels:  wysiwyg
typora-hivacruz-theme
A Typora theme forked from Cobalt to match my other color schemes.
Stars: ✭ 38 (-11.63%)
Mutual labels:  wysiwyg
writer
A small, modern WYSIWYG editor for inline formats – by the team of Kirby CMS
Stars: ✭ 45 (+4.65%)
Mutual labels:  wysiwyg
ngx-wall
Helps build content editor for note-taking application
Stars: ✭ 78 (+81.4%)
Mutual labels:  wysiwyg
arma-dialog-creator
A dialog/GUI creation tool for Arma 3.
Stars: ✭ 73 (+69.77%)
Mutual labels:  wysiwyg
Editor.js
A block-styled editor with clean JSON output
Stars: ✭ 17,061 (+39576.74%)
Mutual labels:  wysiwyg
django-vditor
A WYSIWYG editor plugin made by vditor for django
Stars: ✭ 14 (-67.44%)
Mutual labels:  wysiwyg
nova-froala-field
A Laravel Nova Froala WYSIWYG Editor Field.
Stars: ✭ 110 (+155.81%)
Mutual labels:  wysiwyg
iOS-HTMLTextEditor
A simple implementation of an HTML Editor using CKEditor in a web view.
Stars: ✭ 57 (+32.56%)
Mutual labels:  wysiwyg
ember-pell
Ember addon for simplest and smallest (1kB) WYSIWYG text editor for web, with no dependencies
Stars: ✭ 56 (+30.23%)
Mutual labels:  wysiwyg
django-hyper-editor
Django Integration of Hyper Editor
Stars: ✭ 29 (-32.56%)
Mutual labels:  block-editor
striven-editor
The editor used in the Striven ERP system.
Stars: ✭ 14 (-67.44%)
Mutual labels:  wysiwyg
wysiwyg-editor-node-sdk
Node.JS SDK to ease the integration of Froala WYSIWYG Editor on server side.
Stars: ✭ 25 (-41.86%)
Mutual labels:  wysiwyg
meteor-editable-text-wysiwyg-bootstrap-3
WYSIWYG extension for babrahams:editable-text package for bootstrap-3 apps
Stars: ✭ 18 (-58.14%)
Mutual labels:  wysiwyg
Medium Editor
Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.
Stars: ✭ 15,421 (+35762.79%)
Mutual labels:  wysiwyg
redactor2
Integriert den Redactor WYSIWYG-Editor in Version 2
Stars: ✭ 55 (+27.91%)
Mutual labels:  wysiwyg
codex-web-app
React frontend for Codex (status: open alpha)
Stars: ✭ 58 (+34.88%)
Mutual labels:  wysiwyg
gallery-block-lightbox
Adds a simple & lightweight Lightbox to the standard WordPress Image Gallery Block. No lock in and no dependencies.
Stars: ✭ 31 (-27.91%)
Mutual labels:  block-editor
svelte-slate
slate svelte view layer
Stars: ✭ 43 (+0%)
Mutual labels:  wysiwyg

Blocko

Blocko is a block-based WYSIWYG editor written in ClojureScript meant to be used within JavaScript and ClojureScript projects. Currently, Blocko is not yet production ready, so use at your own risk.

Animated gif of Blocko in action

Install

Browser

  1. Download the latest release
  2. Include blocko.js in your HTML

Usage

blocko.core.init({
    container: '#editor',
    content: [],
    onChange: (content) => {
        // store `content` in your database here.
    }
});

API

  • container: any DOM element that can be targeted via querySelector
  • content: a JS or JSON object representing the initial data
  • options: A JS or JSON object representing configuration
  • onChange: a callback function called when content changes with the updated data

ClojureScript

  1. Add [org.clojars.askonomm/blocko "0.1"] to your dependencies
  2. Since Blocko is using NPM packages, make sure to run it with Shadow-CLJS and add the following dependencies to your package.json:
"dependencies": {
  "@fortawesome/fontawesome-svg-core": "^1.2.35",
  "@fortawesome/free-regular-svg-icons": "^5.15.3",
  "@fortawesome/free-solid-svg-icons": "^5.15.3",
  "@fortawesome/react-fontawesome": "^0.1.14",
  "react": "^17.0.2",
  "react-dom": "^17.0.2",
  "sanitize-html": "^2.4.0"
}

Note: I do try to constantly get rid of the reliance on third-party packages, or at the very least non-Clojars packages, so that at one point there wouldn't be any reliance on NPM and you could also include Blocko in a CLJS project that does not use Shadow-CLJS. Until then however, if you use something other than Shadow-CLJS I recommend you get the browser build instead and add that to your project.

Usage

(ns your-app
  (:require [blocko.core :as blocko]))

(blocko/run 
  {:content []
   :on-change #(fn [content] (prn "store content in your database here"))})

API

  • content: a vector containing the initial data
  • options: A map representing configuration
  • on-change: a callback function called when content changes with the updated data

Options

To configure Blocko you can pass the configuration options to the options argument.

For example, to change the theme in ClojureScript, do this:

(ns your-app
  (:require [blocko.core :as blocko]))

(blocko/run 
  {:content []
   :options {:theme "dark"}
   :on-change #(fn [content] (prn "store content in your database here"))})

Or in JS, do this:

blocko.core.init({
    container: '#editor',
    content: [],
    options: {
      theme: "dark"
    },
    onChange: (content) => {
        // store `content` in your database here.
    }
});

Available options

  • theme - accepts a string which is either "light" or "dark".

Data structure

Blocko uses a very simple data structure to define the content of the editor. It's simply an array of objects, each object representing one block, an the order that the array is in is also the order at which blocks will be displayed on the editor.

Paragraph block

JSON

{"id": "uuid",
 "type": "paragraph",
 "content": "..."}

EDN

{:id "uuid",
 :type "paragraph",
 :content "..."}

Heading block

JSON

{"id": "uuid",
 "type": "heading",
 "content": "..."}

EDN

{:id "uuid",
 :type "heading",
 :content "..."}

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 localhost:8080 in your browser and have fun!

Once you're done with development and want to get the production version, then:

  • To get the browser production build, run ./build.sh release and check inside dist for a brand new blocko.js file.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].