Example of configuration for Monaco #646
-
First, thanks you for this wonderful tool which is "Slidev" it's still a BETA but it feels really polished. Lately, i have been working on a theme for Slidev. I have read the documentation : https://sli.dev/custom/config-monaco.html I have been trying to configure "monaco" using So i decided to delve inside the source code of "slidev" . I found that the monaco instance is already configured with editor = monaco.editor.create(container, {
model,
tabSize: 2,
insertSpaces: true,
detectIndentation: false,
folding: false,
fontSize: +style.getPropertyValue('--slidev-code-font-size').replace(/px/g, ''),
fontFamily: style.getPropertyValue('--slidev-code-font-family'),
lineHeight: +style.getPropertyValue('--slidev-code-line-height').replace(/px/g, ''),
lineDecorationsWidth: 0,
lineNumbersMinChars: 0,
scrollBeyondLastLine: false,
scrollBeyondLastColumn: 0,
automaticLayout: true,
readOnly: props.readonly,
theme: 'vitesse-dark',
lineNumbers: props.lineNumbers as any,
glyphMargin: false,
scrollbar: {
useShadows: false,
vertical: 'hidden',
horizontal: 'hidden',
},
overviewRulerLanes: 0,
minimap: { enabled: false },
}) I would like to be able to override this configuration. Any idea ? my goal at start, was to configure "lineNumbers" to "on" and "readOnly" to Thanks you in advance, for taking the time to consider this message Stéphane Pires |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I have to admit that the Monaco support is pretty barebone since I have used it for only one talk and later not actively looked into it. So there are probably quite some hard-coded parts that I wrote to satisfy only my needs. I am open to exposing better setup APIs to provide full customizability for configuring it. If you see anything missing for you to achieve your needs, feel free to drop some proposals or even PRs. Thanks! |
Beta Was this translation helpful? Give feedback.
I have to admit that the Monaco support is pretty barebone since I have used it for only one talk and later not actively looked into it. So there are probably quite some hard-coded parts that I wrote to satisfy only my needs. I am open to exposing better setup APIs to provide full customizability for configuring it. If you see anything missing for you to achieve your needs, feel free to drop some proposals or even PRs. Thanks!