This gets TextMate grammars working in standalone Monaco by leveraging
vscode-oniguruma
and vscode-textmate
. For more context, see:
microsoft/monaco-editor#1915.
yarn install
yarn demo
- open http://localhost:8084/
Currently, only the Python grammar and VS Code Dark+ themes are included in the
demo.
This fork attempts to get TextMate support for Code App, an iPad IDE. Currently, the fork does the followings.
- Adding most languages from VS Code Extensions
- Adding
vs-light-plus
theme - Workaround for switching themes
- Expose editor to browser window
- Output
monaco-textmate.bundle
to be used within the app
yarn install
yarn build
- Copy
monaco-textmate.bundle
to your app directory
- Host the files with a HTTP server, for example GCDWebServer:
let webServer = GCDWebServer()
webServer.addGETHandler(forBasePath: "/", directoryPath: Bundle.main.path(forResource: "monaco-textmate", ofType: "bundle")!, indexFilename: "index.html", cacheAge: 10, allowRangeRequests: true)
- Load it with a
WKWebView
let webView = WKWebView()
if let address = webServer.serverURL {
let request = URLRequest(url: address)
webView.load(request)
}