All Projects → Pictarine → Codemirror Swiftui

Pictarine / Codemirror Swiftui

Licence: mit
CodeMirror-SwiftUI is a lightweight wrapper of CodeMirror for macOS and iOS packaged for SwiftUI.

Programming Languages

javascript
184084 projects - #8 most used programming language
swift
15916 projects

Projects that are alternatives of or similar to Codemirror Swiftui

CodeMirror-Swift
CodeMirror-Swift is a lightweight wrapper of CodeMirror for macOS and iOS
Stars: ✭ 71 (+136.67%)
Mutual labels:  codemirror
Scripts-n-Styles
Allows WordPress admin users the ability to add custom CSS and JavaScript directly to individual Post, Pages or custom post types.
Stars: ✭ 16 (-46.67%)
Mutual labels:  codemirror
Noty
Autosaving sticky note with support for multiple notes without needing multiple windows.
Stars: ✭ 321 (+970%)
Mutual labels:  codemirror
nwotable
One app for all your notes on all your devices.
Stars: ✭ 22 (-26.67%)
Mutual labels:  codemirror
markdown-editor
✏️ A very simple but useful Markdown Previewer and Markdown Editor with CodeMirror, Markedjs, and Create-react-app
Stars: ✭ 25 (-16.67%)
Mutual labels:  codemirror
CodeMirror-MathJax
Experimenting to replace $math$ with formulas inside CodeMirror
Stars: ✭ 18 (-40%)
Mutual labels:  codemirror
vue-showdowns-editor
A markdown editor using codemirror and previewer using @jhuix/showdowns for Vue.js.
Stars: ✭ 27 (-10%)
Mutual labels:  codemirror
Md2pdf
Offline markdown to pdf, choose -> edit -> transform 🥂
Stars: ✭ 632 (+2006.67%)
Mutual labels:  codemirror
codeRigade
Realtime collaborative code-editor
Stars: ✭ 17 (-43.33%)
Mutual labels:  codemirror
Plantuml Editor
PlantUML online demo client
Stars: ✭ 313 (+943.33%)
Mutual labels:  codemirror
material-ui-markdown-editor
React.js Markdown editor component based on material-ui
Stars: ✭ 28 (-6.67%)
Mutual labels:  codemirror
codemirror-languageserver
Language Server integration for CodeMirror 6
Stars: ✭ 37 (+23.33%)
Mutual labels:  codemirror
notebook
Web based Clojure notebook application/-library.
Stars: ✭ 96 (+220%)
Mutual labels:  codemirror
codemirror-colorpicker
colorpicker with codemirror
Stars: ✭ 113 (+276.67%)
Mutual labels:  codemirror
Angular Admin
🔏Admin client for surmon.me blog powered by @angular and Bootstrap4
Stars: ✭ 352 (+1073.33%)
Mutual labels:  codemirror
react-native-codeditor
React Native component to display code editor using WebView and CodeMirror
Stars: ✭ 21 (-30%)
Mutual labels:  codemirror
Nova-Dark-Theme
A dark theme for Laravel Nova
Stars: ✭ 72 (+140%)
Mutual labels:  codemirror
Codemirror Facade
Facade for the codemirror
Stars: ✭ 8 (-73.33%)
Mutual labels:  codemirror
Graviton App
🚀 A modern-looking Code Editor
Stars: ✭ 601 (+1903.33%)
Mutual labels:  codemirror
codemirror-editor-vue3
CodeMirror component for Vue3
Stars: ✭ 22 (-26.67%)
Mutual labels:  codemirror

CodeMirror-SwiftUI

GitHub tag (latest by date) Swift Package Manager Swift5 Platform GitHub repo size

CodeMirror-SwiftUI

CodeMirror-SwiftUI is a lightweight wrapper of CodeMirror for macOS and iOS packaged for SwiftUI.

This package is a fork from CodeMirror-Swift

Features

  • 🍭 Lightweight CodeMirror wrapper (build 5.57.0)
  • ✅ 100% Native Swift 5 and modern WKWebView
  • 👑 Support iOS & macOS
  • 🎧 Built-in addons
  • 📕 100+ built-in themes and syntax highlight modes
  • ⚡️ Ready to go

Requirements

  • Xcode 12
  • Swift 5.3

Integration

CodeMirror-SwiftUI is available via Swift Package Manager

Using Xcode 12, go to File -> Swift Packages -> Add Package Dependency and enter https://github.com/Pictarine/CodeMirror-SwiftUI

Usage

CodeMirror gives you access to a new view called CodeView. It can be integrated within your view body like this :

CodeView(theme: themes[selectedTheme],
         code: $codeBlock,
         mode: codeMode,
         fontSize: fontSize,
         showInvisibleCharacters: showInvisibleCharacters,
         lineWrapping: lineWrapping)
.onLoadSuccess {
  print("Loaded")
}
.onContentChange { newCodeBlock in
  print("Content Change")
}
.onLoadFail { error in
  print("Load failed : \(error.localizedDescription)")
}

Details

Parameters

CodeView has multiple params:

Parameter name Optional Type Default
code false Binding
mode false Mode
theme true CodeViewTheme .materialPalenight
fontSize true Int 12 (px)
showInvisibleCharacters true Bool true
lineWrapping true Bool true

Modifiers

CodeView comes with three modifiers

onLoadSuccess { ... }
onLoadFail { ... }
onContentChange { ... }

Demo

Screen Shot 2020-08-26 at 7 55 56 PM

License

CodeMirror-SwiftUI is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].