MirrorSharp is a code editor built on Roslyn and CodeMirror</body></html>
Перейти к файлу
Robert Husák 20b232bc4b Add PHP tests 2018-01-23 12:02:07 +01:00
Benchmarks Another build fix. 2017-09-04 22:29:47 +12:00
Common Add project to support PHP using Peachpie 2018-01-14 18:47:37 +01:00
FSharp [closes gh-77] Updated to final 0.9.2. 2017-09-05 23:33:12 +12:00
Owin Build fix. 2017-09-04 22:28:03 +12:00
Owin.Demo [gh-78] Updated to latest F# compiler. 2017-09-05 22:26:45 +12:00
Php Fix consistency issues 2018-01-23 11:57:47 +01:00
Testing [closes gh-77] Updated to final 0.9.2. 2017-09-05 23:33:12 +12:00
Tests.Roslyn2 [gh-78] Updated to latest F# compiler. 2017-09-05 22:26:45 +12:00
Tests.Roslyn2.Net46 Add PHP tests 2018-01-23 12:02:07 +01:00
Tests.Shared [gh-76, gh-56, gh-55] Updated to latest Roslyn. 2017-09-04 22:20:41 +12:00
VisualBasic [closes gh-77] Updated to final 0.9.2. 2017-09-05 23:33:12 +12:00
WebAssets Remove CodeMirror PHP dependency 2018-01-23 12:00:58 +01:00
📄readme [gh-47] Another image improvement. 2017-01-02 23:43:48 +13:00
.editorconfig [closes gh-71] Added xml docs to all public API. 2017-05-23 20:16:33 +12:00
.gitignore [gh-37] Initial attempt at npm publish. 2017-01-03 01:35:32 +13:00
MirrorSharp.sln Add project to support PHP using Peachpie 2018-01-14 18:47:37 +01:00
MirrorSharp.sln.DotSettings Cleaned up support for OptimizationLevel. 2017-05-14 22:07:11 +12:00
NuGet.Common.props [closes gh-71] Added xml docs to all public API. 2017-05-23 20:16:33 +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 Update AppVeyor to deploy NuGet from 0.9 as well. 2017-05-28 23:09:21 +12:00
pack-all.bat Add project to support PHP using Peachpie 2018-01-14 18:47:37 +01: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.