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.
<PackageVersion Include="StepWise.ProseMirror" Version="0.1.15" />
<PackageReference Include="StepWise.ProseMirror" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version 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.
#:package StepWise.ProseMirror@0.1.15
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=StepWise.ProseMirror&version=0.1.15
#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
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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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 | 29,017 | 5/7/2024 |
0.1.14 | 306 | 4/19/2024 |
0.1.13 | 141 | 4/19/2024 |
0.1.12 | 152 | 4/19/2024 |
0.1.11 | 143 | 4/19/2024 |
0.1.10 | 405 | 4/19/2024 |
0.1.9 | 424 | 3/17/2024 |
0.1.8 | 241 | 10/2/2023 |
0.1.7 | 174 | 9/26/2023 |
0.1.6 | 198 | 8/23/2023 |
0.1.5 | 206 | 8/5/2023 |
0.1.3 | 219 | 7/18/2023 |
0.1.2 | 209 | 7/18/2023 |
0.1.1 | 656 | 7/14/2023 |