Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dotnet add package ToastUIEditor
}
```

组件支持通过 `@ref` 访问编辑器/查看器事件和方法。更多 API 请查看 NuGet 包说明和源码中的 XML 文档。
组件支持通过 `@ref` 访问编辑器和查看器的事件与方法。完整 API 请参考源码中的 XML 文档。

## 开发

Expand All @@ -34,8 +34,6 @@ dotnet build ToastUIEditor.sln --configuration Release
dotnet test tests/ToastUIEditor.Tests/ToastUIEditor.Tests.csproj --configuration Release
```

GitHub Actions 会构建和测试 Pull Request;发布 GitHub Release 或手动运行发布工作流即可创建并发布 NuGet 包。

## 许可证

本项目采用 [MIT 许可证](LICENSE)。
35 changes: 35 additions & 0 deletions src/ToastUIEditor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# ToastUI Editor Blazor

`ToastUIEditor` is a Blazor wrapper for the [Toast UI Editor](https://github.com/nhn/tui.editor).
It supports Blazor Server and Blazor WebAssembly applications targeting .NET 6, .NET 7, .NET 8,
.NET 9, and .NET 10.

## Installation

```shell
dotnet add package ToastUIEditor
```

## Quick start

Add `@using ToastUI` to `_Imports.razor` and use the editor or viewer:

```razor
<Editor @bind-Value="content" Options="options" />
<Viewer Value="content" />

@code {
private string content = "# Hello, Toast UI!";
private EditorOptions options = new();
}
```

Use `@ref` to invoke component methods such as `GetMarkdown`, `SetMarkdown`, and `GetHTML`.
The components also expose editor and viewer events. See the repository documentation for
language registration, widget rules, and the complete API.

## Links

- [Repository](https://github.com/ling921/tui.editor.blazor)
- [Toast UI Editor](https://github.com/nhn/tui.editor)
- [NuGet](https://www.nuget.org/packages/ToastUIEditor/)
27 changes: 27 additions & 0 deletions src/ToastUIEditor/README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# ToastUI Editor Blazor

`ToastUIEditor` 是 [Toast UI Editor](https://github.com/nhn/tui.editor) 的 Blazor 封装,支持
Blazor Server 和 Blazor WebAssembly,目标框架包括 .NET 6、.NET 7、.NET 8、.NET 9 和 .NET 10。

## 安装

```shell
dotnet add package ToastUIEditor
```

## 快速开始

在 `_Imports.razor` 中添加 `@using ToastUI`,然后使用编辑器或查看器:

```razor
<Editor @bind-Value="content" Options="options" />
<Viewer Value="content" />

@code {
private string content = "# 你好,Toast UI!";
private EditorOptions options = new();
}
```

可以通过 `@ref` 调用 `GetMarkdown`、`SetMarkdown` 和 `GetHTML` 等组件方法。更多事件、语言和
Widget Rule 用法,请参考[仓库 README](https://github.com/ling921/tui.editor.blazor)。
14 changes: 7 additions & 7 deletions src/ToastUIEditor/ToastUIEditor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

<PropertyGroup>
<PackageId>ToastUIEditor</PackageId>
<VersionPrefix>1.1.1</VersionPrefix>
<VersionPrefix>1.1.0</VersionPrefix>
<Authors>ling921;</Authors>
<Description>Blazor wrapper for ToastUI Editor, see README.md file for more details.</Description>
<Copyright>Copyright © ling921 All rights reserved.</Copyright>
<PackageProjectUrl>https://github.com/ling921/tui.editor.blazor</PackageProjectUrl>
<RepositoryUrl>https://github.com/ling921/tui.editor.blazor</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.nuget.md</PackageReadmeFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>tuieditor;editor;blazor;blazorcomponent;webassembly;</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
Expand All @@ -47,9 +47,9 @@
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.*" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.*" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.*" />
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="assets\i18n\*.js" />
Expand All @@ -59,8 +59,8 @@
<ItemGroup>
<Content Include="..\..\resources\icon.png" Pack="true" PackagePath="\" Visible="false" />
<Content Include="..\..\LICENSE" Pack="true" PackagePath="\" Visible="false" />
<Content Include="..\..\README.nuget.md" Pack="true" PackagePath="\" Visible="false" />
<Content Include="..\..\README.nuget.zh-CN.md" Pack="true" PackagePath="\" Visible="false" />
<Content Include="README.md" Pack="true" PackagePath="\" Visible="false" />
<Content Include="README.zh-CN.md" Pack="true" PackagePath="\" Visible="false" />
</ItemGroup>

</Project>
Loading