codemirror-textlint

1.2.0 • Public • Published

codemirror-textlint

CodeMirror plugin for textlint.

Installation

npm install codemirror-textlint

Usage

var CodeMirror = require("codemirror");
require("./node_modules/codemirror/mode/markdown/markdown.js");
require("./node_modules/codemirror/addon/lint/lint.js");
var createValidator = require("codemirror-textlint");
var noTodo = require("textlint-rule-no-todo");
var validator = createValidator({
    rules: {
        "no-todo": noTodo
    }
});
var editor = CodeMirror.fromTextArea(document.getElementById("code-md"), {
    lineNumbers: true,
    mode: "markdown",
    gutters: ["CodeMirror-lint-markers"],
    lint: {
        "getAnnotations": validator,
        "async": true
    }
});

Tests

npm test

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i codemirror-textlint

Weekly Downloads

2

Version

1.2.0

License

MIT

Last publish

Collaborators

  • azu