Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zikaari committed May 11, 2020
1 parent 45e137e commit e8c5c50
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
```

Expand Down

0 comments on commit e8c5c50

Please sign in to comment.