PalinkBlazor.Markdown
0.0.4
dotnet add package PalinkBlazor.Markdown --version 0.0.4
NuGet\Install-Package PalinkBlazor.Markdown -Version 0.0.4
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="PalinkBlazor.Markdown" Version="0.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PalinkBlazor.Markdown --version 0.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PalinkBlazor.Markdown, 0.0.4"
#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 PalinkBlazor.Markdown as a Cake Addin
#addin nuget:?package=PalinkBlazor.Markdown&version=0.0.4
// Install PalinkBlazor.Markdown as a Cake Tool
#tool nuget:?package=PalinkBlazor.Markdown&version=0.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
editor.md的Blazor封装,包含Markdown编辑器和Markdown Html渲染器
启用Markdown
builder.Services.AddMarkdown();
Markdown编辑器与Markdown渲染器
@inherits LayoutComponentBase
@inject IJSRuntime _js;
<div>
<h1>Markdown</h1>
<MarkdownEditor @bind-Html="@Html" @bind-Markdown="@Markdown"
Height="700" SaveMarkdown="Save" Theme="@MarkdownTheme.DarkTheme"
Width="0.8">
</MarkdownEditor>
<MarkdownHtmlRender @bind-Markdown="Markdown" MinWidth="1024px"></MarkdownHtmlRender>
<div>
@Body
</div>
</div>
@code {
public string? Markdown { get; set; }
public string? Html { get; set; }
private async void Save() {
await _js.InvokeVoidAsync("alert", "\n💥💢好像漏了点什么吧💢💥");
}
protected override void OnInitialized() {
var txt = File.ReadAllText(@"C:\Users\Palink\Desktop\markdown.txt");
Markdown = txt;
}
}
编辑器效果
暗黑模式
明亮模式
Html渲染效果
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Microsoft.AspNetCore.Components.Web (>= 6.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
优化部分功能、增加完整说明书