monaco-python
TypeScript icon, indicating that this package has built-in type declarations

0.1.9 • Public • Published

monaco-python

monaco-editor with python lsp in browser

install

npm i monaco-python

usage

basic usage

import start from 'monaco-python';

await start(document.getElementById('container'), {
	value: 'print("hello world!")'
});

customize theme

import start, { E_EDITOR_THEME } from 'monaco-python';

await start(document.getElementById('container'), {
	theme: E_EDITOR_THEME.MONOKAI,
});

customize typesheds

import start from 'monaco-python';

await start(document.getElementById('container'), {
	typesheds: {
		'stubs/testtt/testtt.pyi': 'def test(words: str) -> str: ...'
	}
});

customize typesheds

import start from 'monaco-python';

await start(document.getElementById('container'), {
	snippets: {
		testtt: {
			prefix: "tt",
			body: "testtt(${1:words})",
			description: "testtt"
		}
	}
});

vim mode

import start from 'monaco-python';
import { initVimMode } from 'monaco-vim';

const wrapper = await start(document.getElementById('container'), {
	value: 'print("hello world!")'
});
const editor = wrapper.getEditor();

const vimMode = initVimMode(editor, document.getElementById('my-statusbar'))

Readme

Keywords

none

Package Sidebar

Install

npm i monaco-python

Weekly Downloads

89

Version

0.1.9

License

none

Unpacked Size

20 MB

Total Files

47

Last publish

Collaborators

  • qinjia