Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
/ monaco-tm Public archive
forked from bolinfest/monaco-tm

Attempt to get TextMate grammars working in standalone Monaco

License

Notifications You must be signed in to change notification settings

thebaselab/monaco-tm

 
 

Repository files navigation

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

About

Attempt to get TextMate grammars working in standalone Monaco

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 72.7%
  • HTML 25.6%
  • JavaScript 1.7%