StepWise.ProseMirror
0.1.15
Prefix Reserved
dotnet add package StepWise.ProseMirror --version 0.1.15
NuGet\Install-Package StepWise.ProseMirror -Version 0.1.15
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="StepWise.ProseMirror" Version="0.1.15" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StepWise.ProseMirror --version 0.1.15
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: StepWise.ProseMirror, 0.1.15"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install StepWise.ProseMirror as a Cake Addin #addin nuget:?package=StepWise.ProseMirror&version=0.1.15 // Install StepWise.ProseMirror as a Cake Tool #tool nuget:?package=StepWise.ProseMirror&version=0.1.15
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ProseMirror.Net
[!NOTE] This project is not dead! ProseMirror's core packages see very little change due to maturity; including bug fixes. ProseMirror.Net powers the collaborative editing backend at StepWiseHQ.
The best way to work with ProseMirror document models in DotNet:
- Document and step DTOs for serialization/deserialization
- Building and updating documents server-side
- Server-side schema validation
- Building collaborative editing backends
ProseMirror.Net is a direct translation of the core ProseMirror packages from TypeScript to C#
-
prosemirror-model
-
prosemirror-transform
-
prosemirror-test-builder
-
prosemirror-schema-basic
-
prosemirror-schema-list
Getting Started
dotnet add package StepWise.ProseMirror
Basic Usage
using StepWise.Prose.Model;
var schemaSpec = new SchemaSpec() {
Nodes = new()
{
["doc"] = new() { Content = "paragraph+" },
["paragraph"] = new() { Content = "text*" },
["text"] = new() { }
},
Marks = new()
};
var schema = new Schema(schemaSpec);
var doc = schema.Node("doc", null, [
schema.Node("paragraph", null, [
schema.Text("Hello World")
], null)
], null);
Console.WriteLine(doc.ToString()); // doc(paragraph("Hello World"))
Test Builder & Transform
using StepWise.Prose.Model;
using StepWise.Prose.TestBuilder;
using StepWise.Prose.Transformation;
using static StepWise.Prose.TestBuilder.Builder;
Node node = doc(p("Hello <a>"));
var tr = new Transform(node);
tr.ReplaceWith(node.Tag()["a"], node.Tag()["a"], schema.Text("World"));
Console.WriteLine(tr.Doc.ToString()); // doc(paragraph("Hello World"))
Deserializing Steps
using StepWise.Prose.Model;
using StepWise.Prose.TestBuilder;
using StepWise.Prose.Transformation;
using static StepWise.Prose.TestBuilder.Builder;
Node node = doc(p("Hello <a>"));
var stepJsonString = """{"stepType":"replace","from":7,"to":7,"slice":{"content":[{"type":"text","text":"World","marks":[]}]}}""";
var step = Step.FromJSON(Builder.schema, StepDto.FromJson(stepJsonString));
var tr = new Transform(node);
tr.Step(step);
Console.WriteLine(tr.Doc.ToString()); // doc(paragraph("Hello World"))
Deserializing Docs(Nodes)
using StepWise.Prose.Model;
using StepWise.Prose.TestBuilder;
var docJsonString = """{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Hello World","marks":[]}],"marks":[]}],"marks":[]}""";
var doc = Node.FromJSON(Builder.schema, NodeDto.FromJson(docJsonString));
Console.WriteLine(doc.ToString()); // doc(paragraph("Hello World"))
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- DotNext (>= 4.12.4)
- Json.More.Net (>= 1.8.0)
- OneOf (>= 3.0.255)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.1.15 | 6,243 | 5/7/2024 |
0.1.14 | 249 | 4/19/2024 |
0.1.13 | 117 | 4/19/2024 |
0.1.12 | 130 | 4/19/2024 |
0.1.11 | 121 | 4/19/2024 |
0.1.10 | 377 | 4/19/2024 |
0.1.9 | 398 | 3/17/2024 |
0.1.8 | 221 | 10/2/2023 |
0.1.7 | 153 | 9/26/2023 |
0.1.6 | 172 | 8/23/2023 |
0.1.5 | 180 | 8/5/2023 |
0.1.3 | 188 | 7/18/2023 |
0.1.2 | 178 | 7/18/2023 |
0.1.1 | 625 | 7/14/2023 |