From e8c5c506f9e158f10cfacb1a14916fc26a3704d5 Mon Sep 17 00:00:00 2001 From: Neek Sandhu Date: Mon, 11 May 2020 01:19:10 -0700 Subject: [PATCH] Update readme --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b5d58d0..5594bd6 100644 --- a/README.md +++ b/README.md @@ -35,16 +35,23 @@ export async function liftOff() { grammars.set('html', 'text.html.basic') grammars.set('typescript', 'source.ts') - await wireTmGrammars(monaco, registry, grammars) - + // monaco's built-in themes aren't powereful enough to handle TM tokens + // https://github.com/Nishkalkashyap/monaco-vscode-textmate-theme-converter#monaco-vscode-textmate-theme-converter + monaco.editor.defineTheme('vs-code-theme-converted', { + // ... use `monaco-vscode-textmate-theme-converter` to convert vs code theme and pass the parsed object here + }); + var editor = monaco.editor.create(document.getElementById('container'), { value: [ 'html, body {', ' margin: 0;', '}' ].join('\n'), - language: 'css' // this won't work out of the box, see below for more info + language: 'css', // this won't work out of the box, see below for more info, + theme: 'vs-code-theme-converted' // very important, see comment above }) + + await wireTmGrammars(monaco, registry, grammars, editor) } ```