Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with Monaco? #37

Open
CapitaineToinon opened this issue May 29, 2024 · 6 comments
Open

Usage with Monaco? #37

CapitaineToinon opened this issue May 29, 2024 · 6 comments

Comments

@CapitaineToinon
Copy link

Hello !

I've been looking at various markdown supersets and how to integrate them on a website through editors such as the monaco editor. As far as I understand, while monaco powers vscode under the hood, it's not possible to directly use such an extension with monaco. I'd love some direction if I'm wrong on that point though.

Allowing for this would be incredibly powerful in my opinion. Being able to store MDC content in a database and edit it through an admin dashboard would be great.

This project doesn't have discussions open so I'm opening a ticket instead, sorry about that.

Thanks for the help !

Copy link
Member

atinux commented May 29, 2024

I believe @farnabaz made it work inside an embedded Monaco Editor

@CapitaineToinon
Copy link
Author

I felt down quite the rabbit hole looking into this. Apparently vscode supports text-mate configuration files out of the box but monaco does not. Seems to be possible to load those anyway using some wasm regex library but all the examples are old and not maintained. If someone has an example up and running, I would love to be able to take a look.

@farnabaz
Copy link
Collaborator

Hey @CapitaineToinon,
Sadly, monaco does not support text-mate languages, instead it has its own way that called monarch.

You can use nuxtlabs/monarch-mdc to allow highlighting MDC in monaco.

@CapitaineToinon
Copy link
Author

Yeah I figured, although projects like https://github.com/bolinfest/monaco-tm managed to get it working apprently. Microsoft has a vscode-oniguruma package with a compiled wasm build that can be imported to then use vscode-textmate directly with monaco but everything being just not documented I couldn't get it to work.

It's great if there is a monarch version though! I assumed such a package existed as I used nuxthub for a while. However that package is private? That like gives me a 404.

@CapitaineToinon
Copy link
Author

Oh okay seems to be accessible through npm and installs just fine. Thanks, will try that!

https://www.npmjs.com/package/@nuxtlabs/monarch-mdc

Copy link
Collaborator

Yeah, may bad. It is not yet public, you can use it directly from npm https://www.npmjs.com/package/@nuxtlabs/monarch-mdc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants