1.1.0 • Published 7 years ago

codex.editor.marker v1.1.0

Weekly downloads
26
License
MIT
Repository
github
Last release
7 years ago

npm.io

Marker Tool

Marker Tool for highlighting text-fragments for the CodeX Editor.

npm.io

Installation

Install via NPM

Get the package

npm i --save-dev codex.editor.marker

Include module at your application

const Marker = require('codex.editor.marker');

Download to your project's source dir

  1. Upload folder dist from repository
  2. Add dist/bundle.js file to your page.

Load from CDN

You can load specific version of package from jsDelivr CDN.

https://cdn.jsdelivr.net/npm/codex.editor.marker@1.0.1

Require this script on a page with CodeX Editor.

<script src="..."></script>

Usage

Add a new Tool to the tools property of the CodeX Editor initial config.

var editor = CodexEditor({
  ...
  
  tools: {
    ...
    Marker: {
      class: Marker,
      shortcut: 'CMD+SHIFT+M',
    }
  },
  
  ...
});

Config Params

This Tool has no config params

Output data

Marked text will be wrapped with a mark tag with an cdx-marker class.

{
    "type" : "text",
    "data" : {
        "text" : "Create a directory for your module, enter it and run <mark class=\"cdx-marker\">npm init</mark> command."
    }
}