colonel-kurtz
A block editor
Last updated 3 years ago .
· Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install colonel-kurtz 
SYNC missed versions from official npm registry.

NPM


A block based content editor powered by React. Colonel Kurtz provides a front-end for building pages as a series of blocks, serializing to a JSON data structure.


CircleCI codecov


Colonel Kurtz

Colonel Kurtz is a content editor written in React. It forces content to be broken up into individual types, such as a photo or chunk of text, and provides a user interface for managing those "blocks" of content, reordering them, and even nesting them inside other content.

colonel

Comprehensive documentation can be found under the ./docs directory of this repo. However the content that follows should provide a high level overview:

Data format

Colonel Kurtz can be serialized down to JSON. This structure looks like:

[
  {
    "blocks": [],
    "content": {
      "html": "<p>This is introductory text.<br></p>",
      "text": "This is introductory text."
    },
    "type": "medium"
  },
  {
    "blocks": [
      {
        "blocks": [],
        "content": {
          "src": "http://fizbuz.com/image.jpg"
        },
        "type": "image"
      },
      {
        "blocks": [],
        "content": {
          "html": "<p>Sweet, sweet content.<br></p>",
          "text": "Sweet, sweet content."
        },
        "type": "medium"
      }
    ],
    "type": "section"
  },
  {
    "blocks": [],
    "content": {
      "html": "<p>This is footer text.<br></p>",
      "text": "This is footer text."
    },
    "type": "medium"
  }
]

A block has three important pieces of information:

  1. content: A map of information captured about a block. This could be display settings, rich text, etc.
  2. type: Blocks are created within a given block type (more on this later). This block type has an identifier which is stored at this key (type). This is used to communicate how content should be displayed and how the editor should expose the content for modification.
  3. blocks: A block can have child blocks, stored as an array. The structure of child blocks is exactly the same as top-level blocks.

Configuring

More thorough documentation can be found at ./docs/colonel.md however at a high level, Colonel Kurtz is installed with code loosely following:

import ColonelKurtz from 'colonel-kurtz'
import BlockType from './path/to/react/component'

var container = document.querySelector('#container')
var input = document.querySelector('#input')

var editor = new ColonelKurtz({
  el: container,
  blocks: JSON.parse(input.value),
  blockTypes: [
    {
      id: 'a-block',
      label: 'This is a block',
      component: BlockType
    }
  ]
})

Code At Viget

Visit code.viget.com to see more projects from Viget.

Current Tags

  • 5.0.0-beta                                ...           beta (4 years ago)
  • 5.2.1                                ...           latest (3 years ago)
  • 2.23.2                                ...           support (6 years ago)

89 Versions

  • 0.0.1                                ...           7 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.3                                ...           7 years ago
  • 0.0.4                                ...           7 years ago
  • 0.0.5                                ...           7 years ago
  • 0.0.6                                ...           7 years ago
  • 0.0.7                                ...           7 years ago
  • 0.0.8                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
  • 0.2.0                                ...           7 years ago
  • 0.2.1                                ...           7 years ago
  • 0.3.0                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 2.0.0-rc1                                ...           7 years ago
  • 2.0.0-rc2                                ...           7 years ago
  • 2.0.0                                ...           7 years ago
  • 2.0.1                                ...           7 years ago
  • 2.1.0                                ...           7 years ago
  • 2.1.1                                ...           7 years ago
  • 2.3.0                                ...           7 years ago
  • 2.4.0                                ...           7 years ago
  • 2.5.0                                ...           7 years ago
  • 2.5.1                                ...           7 years ago
  • 2.5.2                                ...           7 years ago
  • 2.7.0                                ...           7 years ago
  • 2.8.0                                ...           7 years ago
  • 2.9.0                                ...           7 years ago
  • 2.10.0                                ...           7 years ago
  • 2.11.0                                ...           7 years ago
  • 2.12.0-rc1                                ...           7 years ago
  • 2.12.0-rc2                                ...           7 years ago
  • 2.12.0                                ...           7 years ago
  • 2.12.1                                ...           7 years ago
  • 2.12.2                                ...           7 years ago
  • 2.13.0                                ...           7 years ago
  • 2.14.0                                ...           7 years ago
  • 2.15.0                                ...           7 years ago
  • 2.16.0-rc1                                ...           7 years ago
  • 2.16.0                                ...           7 years ago
  • 2.16.1                                ...           7 years ago
  • 2.16.2                                ...           7 years ago
  • 2.17.0-rc1                                ...           7 years ago
  • 2.17.0                                ...           7 years ago
  • 2.18.0-alpha                                ...           7 years ago
  • 2.18.0-beta                                ...           7 years ago
  • 2.18.0-rc1                                ...           7 years ago
  • 2.18.0-rc2                                ...           7 years ago
  • 2.18.0                                ...           7 years ago
  • 2.19.0                                ...           7 years ago
  • 2.20.0                                ...           7 years ago
  • 2.21.0-rc1                                ...           7 years ago
  • 2.21.0                                ...           7 years ago
  • 2.22.0                                ...           7 years ago
  • 2.23.0-alpha                                ...           7 years ago
  • 2.23.0-alpha2                                ...           7 years ago
  • 2.23.0-alpha3                                ...           7 years ago
  • 2.23.0-rc                                ...           7 years ago
  • 2.23.0                                ...           7 years ago
  • 2.23.0-rc1                                ...           7 years ago
  • 2.23.1-rc1                                ...           7 years ago
  • 2.23.1-rc2                                ...           7 years ago
  • 2.23.1-rc3                                ...           7 years ago
  • 2.23.1-rc4                                ...           7 years ago
  • 2.23.1-rc5                                ...           7 years ago
  • 3.0.0-beta                                ...           7 years ago
  • 3.0.0                                ...           7 years ago
  • 3.1.0-alpha                                ...           6 years ago
  • 3.1.0                                ...           6 years ago
  • 3.1.1                                ...           6 years ago
  • 2.23.2                                ...           6 years ago
  • 3.2.0-rc                                ...           6 years ago
  • 3.2.0                                ...           6 years ago
  • 3.3.0                                ...           6 years ago
  • 3.4.0-rc                                ...           6 years ago
  • 3.4.0                                ...           6 years ago
  • 3.5.0                                ...           6 years ago
  • 3.5.1                                ...           6 years ago
  • 4.0.0                                ...           6 years ago
  • 4.1.0-rc                                ...           6 years ago
  • 4.1.0                                ...           6 years ago
  • 4.2.0                                ...           5 years ago
  • 4.2.1                                ...           5 years ago
  • 4.3.0                                ...           5 years ago
  • 5.0.0-beta                                ...           4 years ago
  • 5.0.0                                ...           4 years ago
  • 5.0.1                                ...           4 years ago
  • 5.0.2                                ...           4 years ago
  • 5.2.0                                ...           3 years ago
  • 5.2.1                                ...           3 years ago
Dependencies (6)
Dev Dependencies (0)
None

Copyright © npmmirror.com | 浙ICP备15033595号-63 |