MirrorSharp is a code editor built on Roslyn and CodeMirror</body></html>
Перейти к файлу
Andrey Shchekin b995baa9d2 [closes gh-69] Removed Bower support (and cleaned up few more things). 2017-05-22 21:53:01 +12:00
Benchmarks Initial prototype. 2017-05-14 00:57:31 +12:00
Common Exposed default options to the user and delayed option setup to the moment language is actually used. 2017-05-22 21:20:49 +12:00
FSharp Exposed default options to the user and delayed option setup to the moment language is actually used. 2017-05-22 21:20:49 +12:00
Owin Exposed default options to the user and delayed option setup to the moment language is actually used. 2017-05-22 21:20:49 +12:00
Owin.Demo [closes gh-69] Removed Bower support (and cleaned up few more things). 2017-05-22 21:53:01 +12:00
Testing Corrected NuGet version for Testing. 2017-05-22 21:23:42 +12:00
Tests.Roslyn2 [closes gh-68] Extracted VisualBasic support into a separate library. 2017-05-22 20:41:06 +12:00
Tests.Roslyn2.Net46 Exposed default options to the user and delayed option setup to the moment language is actually used. 2017-05-22 21:20:49 +12:00
Tests.Shared Exposed default options to the user and delayed option setup to the moment language is actually used. 2017-05-22 21:20:49 +12:00
VisualBasic Exposed default options to the user and delayed option setup to the moment language is actually used. 2017-05-22 21:20:49 +12:00
WebAssets [closes gh-69] Removed Bower support (and cleaned up few more things). 2017-05-22 21:53:01 +12:00
📄readme [gh-47] Another image improvement. 2017-01-02 23:43:48 +13:00
.editorconfig [closes gh-61] Updated implementation to handle long messages without extra buffer allocations. 2017-03-26 15:39:50 +13:00
.gitignore [gh-37] Initial attempt at npm publish. 2017-01-03 01:35:32 +13:00
MirrorSharp.sln [closes gh-68] Extracted VisualBasic support into a separate library. 2017-05-22 20:41:06 +12:00
MirrorSharp.sln.DotSettings Cleaned up support for OptimizationLevel. 2017-05-14 22:07:11 +12:00
Publish-ToNpm.ps1 [gh-37] Suppressed re-publish errors. 2017-01-03 02:22:21 +13:00
README.md [closes gh-69] Removed Bower support (and cleaned up few more things). 2017-05-22 21:53:01 +12:00
appveyor.yml [gh-65] Temporarily disabled .Net46 tests (passes on local). 2017-05-15 23:23:40 +12:00
pack-all.bat Minor fix to pack-all.bat. 2017-05-22 21:45:51 +12:00

README.md

Overview

MirrorSharp is a code editor <textarea> built on Roslyn and CodeMirror.

Features

Code completion

Code completion

Signature help

Signature help

Quick fixes

Quick fixes

Diagnostics

Diagnostics

Usage

You'll need the following:

  • MirrorSharp.Owin on the server (.NET Core is planned, but not supported yet)
  • mirrorsharp.js — client library that provides the user interface

Server

MirrorSharp.Owin

NuGet: Install-Package MirrorSharp.Owin -Pre
Once installed, call app.UseMirrorSharp() in your OWIN startup.

Client

NPM: npm install mirrorsharp --save

CSS

If you are using LESS, CSS references can be done automatically by including mirrorsharp/mirrorsharp.less.
Otherwise, make sure to include the following:

  1. codemirror/lib/codemirror.css
  2. codemirror/addon/lint/lint.css
  3. codemirror/addon/hint/show-hint.css
  4. codemirror-addon-lint-fix/addon/lint-fix/lint-fix.css
  5. mirrorsharp/mirrorsharp.css

JS

JS can be done automatically since mirrorsharp has proper requires. Otherwise:

  1. codemirror/lib/codemirror.js
  2. codemirror/mode/clike/clike.js
  3. codemirror/addon/lint/lint.js
  4. codemirror/addon/hint/show-hint.js
  5. codemirror-addon-lint-fix/addon/lint-fix/lint-fix.js
  6. mirrorsharp/mirrorsharp.js

Usage

Once referenced, you can do the following:

mirrorsharp(textarea, { serviceUrl: 'wss://your_app_root/mirrorsharp' })

If you're not using HTTPS, you'll likely need ws:// instead of wss://.

Note that textarea is an actual textarea element, and not a CSS selector or jQuery object.

API

TODO. In general the idea is that "it just works", however customization is a goal and some options are already available.

Testing

TODO, but see MirrorSharp.Testing on NuGet.