Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aatauil/codemirror-lang-turtle

TURTLE grammar for Lezer parser
https://github.com/aatauil/codemirror-lang-turtle

codemirror6 lezer-grammar rdf semantic-web turtle

Last synced: 18 days ago
JSON representation

TURTLE grammar for Lezer parser

Awesome Lists containing this project

README

        

# CodeMirror TURTLE Language Support

NPM version badge

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

### Usage

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

const doc = `
@prefix rdf: .
@prefix dc: .
@prefix ex: .

dc:title "RDF/XML Syntax Specification (Revised)" ;
ex:editor [
ex:fullname "Dave Beckett";
ex:homePage
] .
`

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