A CodeMirror 6 playground built with WebSharper and the WebSharper.CodeMirror bindings: pick a language, edit the snippet, and toggle between the light and dark themes.
- A full CodeMirror 6 editor configured entirely from F# with
EditorView(EditorViewConfig(...)),CodeMirror.BasicSetupand a language extension. - Language support for JavaScript, TypeScript, Python, HTML, CSS, JSON, SQL and
Markdown, each shipped as an
@codemirror/lang-*package. - A theme toggle that recreates the editor with
CodeMirror.OneDark.
src/Client.fskeeps the current language and theme inVars and rebuilds theEditorViewwhen either changes; the editor mounts into a host element viaon.afterRender.- CodeMirror and its language packages are bundled from npm by esbuild.
dotnet run --project src
Then open http://localhost:5431.
dotnet build src/CodeMirror.fsproj -c Release
Every push to master builds in Release and publishes src/wwwroot to the
gh-pages branch via .github/workflows/deploy.yml.
