A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.npmjs.com/package/codemirror-lang-inform7 below:

codemirror-lang-inform7 - npm

Inform 7 for CodeMirror

This package implements Inform 7 syntax highlighting for the CodeMirror 6 code editor.

Inform 7 extensions are not fully supported. (They are mostly fine, only extension-specific parts such as the documentation are not highlighted.)

Inform 6 inclusions have basic highlighting, and Preform inclusions are not supported at all.

Usage
import { EditorState, EditorView, basicSetup } from "@codemirror/basic-setup"

import { inform7 } from "codemirror-lang-inform7"

const editor = new EditorView({
	state: EditorState.create({
		extensions: [
			basicSetup,
			EditorView.lineWrapping,
			inform7(),
		],
	}),
	parent: document.body,
})
Theming

The highlighter uses the following tags in Inform 7:

Inside I6 inclusions, the following are used:

For developers

The syntax highlighting is implemented with a stream parser in src/index.ts.

To build, use:

$ npm run prepare

To test the highlighting in a CodeMirror editor, use:

$ npm run build-preview

Then you can open the file preview/index.html in your favourite browser and type some Inform 7 code.

License

MIT. See the file LICENSE at the root of the repository.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4