codemirror-lang-notation3
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

CodeMirror Notation3 Language Support

NPM version badge

A CodeMirror extension that provides Notation3 syntax highlighting and language support.

Most of the code and grammar for this extension were written by Achraf Atauil for their codemirror-lang-turtle extension.

Usage

import { basicSetup } from 'codemirror';
import { EditorView } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { notation3 } from 'codemirror-lang-notation3';

const doc = `
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix : <http://example.org/>.

{ 
  :weather a :Raining
} => {
  :weather a :Cloudy
} . 
`

new EditorView({
  state: EditorState.create({
    doc,
    extensions: [
      basicSetup,
      notation3(),
    ],
  }),
  parent: document.querySelector('#editor'),
});

Readme

Keywords

none

Package Sidebar

Install

npm i codemirror-lang-notation3

Weekly Downloads

4

Version

0.0.3

License

MIT

Unpacked Size

22.5 kB

Total Files

5

Last publish

Collaborators

  • rybesh