-
Notifications
You must be signed in to change notification settings - Fork 4
Make source code snippets into CodeMirror editor instances #20
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
Conversation
alerque
commented
Dec 2, 2025
- Display code views as CodeMirror editor instances
- Add ignore file covering current build artifacts
- Enable syntax highlighting in CodeMirror
- [NFY] Setup Typst syntax highlighting via WASM module
|
@kxxt This is not at all your fault, just my lack of experience with building stuff for the modern web, but I'm absolutely baffled how to bundle/build your codemirror-lang-typst module in a way that can be used in the browser. This builds and has the JS code inlinned and copies the WASM module to the static output directory where it is served, but I can't seem to orchestrate it all to get around the browser error: Do you know of any projects building for a browser environment that I could take a gander at? |
I am using it in an overleaf fork(overleaf/overleaf#1385), which uses the React stack and webpack bundler Aside from that, I know that the TeXlyre editor is also using this package: https://github.com/TeXlyre/texlyre/blob/main/src/services/EditorLoader.ts I don't know if there are other projects using the esbuild bundler with my package but I could take a deeper look at integration issues with it later. |
|
@alerque But in case if you only want syntax highlighting and not a full-featured editor, there are also https://shiki.style/ . |
|
Hi @alerque, I took a deeper look at it and created a PR #21. The primary reason that it didn't work is because of the missing esbuild wasm plugin. But if the purpose is only syntax highlighting static text, I think codemirror is too heavy weight for it and https://shiki.style/ should be more suitable. |
I agree if the only purpose was for syntax, shiki would be a better approach. My ultimate goal is to get some or all of the typesetters working in a sandboxed playground mode where the source snippets can be played with in place, hence the desire to get CodeMirror spun up anyway. And thanks immensely for this. I spent half my day tinkering with |