bluebell-monaco 4.2.0
Install from the command line:
Learn more about npm packages
$ npm install @laws-africa/bluebell-monaco@4.2.0
Install via package.json:
"@laws-africa/bluebell-monaco": "4.2.0"
About this version
Bluebell grammar support for the Monaco Editor.
- Language/syntax rules and a corresponding theme to enable syntax highlighting. Enabled with
registerLanguage()
. - Actions for monaco to apply formatting (eg. bold, italics). Enabled with
installActions()
and triggered usingeditor.trigger('...', 'format.bold')
. - An Indigo GrammarModel for Bluebell
This repo's AKN-to-text XSLT is automatically updated when
bluebell/akn_text.xsl
is updated in the
Bluebell repo.
Install with
npm install @laws-africa/bluebell-monaco
Configure syntax highlighting by registering the language with monaco:
import { registerLanguage } from "bluebell-monaco";
registerLanguage();
and then specify the language and theme when creating your editor:
import { LANGUAGE_ID, THEME_ID } from "bluebell-monaco";
const editor = monaco.editor.create(elem, {
language: LANGUAGE_ID,
theme: THEME_ID
});
Once you have created a monaco editor instance, setup Bluebell-related edit actions like this:
import { installActions } from "bluebell-monaco";
installActions(editor);
// trigger the format.bold action
editor.trigger('your-app', 'format.bold');
- Install dependencies:
npm install
- Run tests:
npm test
There's a small demo editor to test functionality. To use it:
cd demo
npx webpack
- run
demo/index.html
in PyCharm to launch a webserver
- Make your changes.
- Update the version in package.json, according to semver.org
- Commit and push.
- Create a new release in GitHub releases
- Github will package the release automatically