Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Latest commit

 

History

History
46 lines (36 loc) · 1.36 KB

README.md

File metadata and controls

46 lines (36 loc) · 1.36 KB

monaco-tm

This gets TextMate grammars working in standalone Monaco by leveraging vscode-oniguruma and vscode-textmate. For more context, see: microsoft/monaco-editor#1915.

Run demo

Currently, only the Python grammar and VS Code Dark+ themes are included in the demo.


About the Fork

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

Build for iOS App

  • yarn install
  • yarn build
  • Copy monaco-textmate.bundle to your app directory

Integrating the editor in iOS

  • 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)
   }