ashmind/mirrorsharp
关于
MirrorSharp is a code editor <textarea> built on Roslyn and CodeMirror
开发工具实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Overview
MirrorSharp is a reusable client-server code editor component built on Roslyn and CodeMirror.
Features
Code completion

Signature help

Quick fixes

Diagnostics

Quick info

Usage
You'll need the following:
- MirrorSharp.AspNetCore on the server (MirrorSharp.Owin if .NET Framework)
- mirrorsharp.js — client library that provides the user interface
Server
MirrorSharp.AspNetCore
Install-Package MirrorSharp.AspNetCore
If using Endpoint Routing (3.0+ only):
app.UseEndpoints(endpoints => {
// ...
endpoints.MapMirrorSharp("/mirrorsharp");
});
If not using Endpoint Routing:
app.MapMirrorSharp("/mirrosharp");
MirrorSharp.Owin
Install-Package MirrorSharp.Owin
In your Startup:
app.MapMirrorSharp("/mirrosharp");
Client
| Library | Type | NPM |
|---|---|---|
| mirrorsharp-codemirror-6-preview | Latest | |
| mirrorsharp | Stable |
npm install mirrorsharp-codemirror-6-preview --save
Note: The name is temporary — once all testing on 6-preview is completed, it will become mirrorsharp 3.
Breaking Changes
Version mirrorsharp-codemirror-6-preview (future mirrorsharp 3.0+) includes a number of breaking changes — see migration-from-2.md for the full migration guide.
Build
Since mirrorsharp JS files are not bundled, you'll need to use a bundler such as Webpack, Parcel or ESBuild.
You can see a Parcel example in AspNetCore.Demo.
Note that mirrorsharp is written in TypeScript, and the package includes full TypeScript types.
Note: You need to manually require/import mirrorsharp/mirrorsharp.css into your bundle.
Usage
import mirrorsharp from 'mirrorsharp-codemirror-6-preview';
mirrorsharp(container, { serviceUrl: 'wss://your_app_root/mirrorsharp' });
If you're not using HTTPS, you'll likely need ws:// instead of wss://.
Note that the container is an actual HTML element, and not a CSS selector.
API
TODO. In general the idea is that "it just works", however customization is a goal and some options are already available.
Demos
You can check out the demos if you clone the repository locally.
After cloning, run ms setup to build and prepare everything.
Testing
TODO, but see MirrorSharp.Testing on NuGet.
探索相关项目
加载中…