-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0cbd74c
commit cb9bab2
Showing
9 changed files
with
301 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@using Markdig | ||
@using Microsoft.JSInterop; | ||
@inject IJSRuntime jsRuntime | ||
|
||
@((MarkupString)Markdown.ToHtml(Content)) | ||
|
||
@code { | ||
[Parameter] public string Content { get; set; } | ||
Check warning on line 8 in WSM.Markdown/ReadmeView.razor GitHub Actions / build
|
||
[Parameter] public bool ChangeOnRender { get; set; } | ||
protected override void OnAfterRender(bool firstRender) | ||
{ | ||
if (ChangeOnRender || firstRender) | ||
jsRuntime.InvokeVoidAsync("initPrism"); | ||
base.OnAfterRender(firstRender); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Razor"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
|
||
<ItemGroup> | ||
<SupportedPlatform Include="browser" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Markdig" Version="0.33.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.10" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@using Microsoft.AspNetCore.Components.Web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
| ||
pre { | ||
position: relative; | ||
padding: 1em; | ||
background-color: #f0f0f0; | ||
border: 1px solid #ddd; | ||
border-radius: 4px; | ||
} | ||
|
||
code { | ||
display: block; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
@import "copyButton.css"; | ||
|
||
code[class*=language-], pre[class*=language-] { | ||
color: #000; | ||
background: 0 0; | ||
text-shadow: 0 1px #fff; | ||
font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; | ||
font-size: 1em; | ||
text-align: left; | ||
white-space: pre; | ||
word-spacing: normal; | ||
word-break: normal; | ||
word-wrap: normal; | ||
line-height: 1.5; | ||
-moz-tab-size: 4; | ||
-o-tab-size: 4; | ||
tab-size: 4; | ||
-webkit-hyphens: none; | ||
-moz-hyphens: none; | ||
-ms-hyphens: none; | ||
hyphens: none | ||
} | ||
|
||
code[class*=language-] ::-moz-selection, code[class*=language-]::-moz-selection, pre[class*=language-] ::-moz-selection, pre[class*=language-]::-moz-selection { | ||
text-shadow: none; | ||
background: #b3d4fc | ||
} | ||
|
||
code[class*=language-] ::selection, code[class*=language-]::selection, pre[class*=language-] ::selection, pre[class*=language-]::selection { | ||
text-shadow: none; | ||
background: #b3d4fc | ||
} | ||
|
||
@media print { | ||
code[class*=language-], pre[class*=language-] { | ||
text-shadow: none | ||
} | ||
} | ||
|
||
pre[class*=language-] { | ||
padding: 1em; | ||
margin: .5em 0; | ||
overflow: auto | ||
} | ||
|
||
:not(pre) > code[class*=language-], pre[class*=language-] { | ||
background: #f5f2f0 | ||
} | ||
|
||
:not(pre) > code[class*=language-] { | ||
padding: .1em; | ||
border-radius: .3em; | ||
white-space: normal | ||
} | ||
|
||
.token.cdata, .token.comment, .token.doctype, .token.prolog { | ||
color: #708090 | ||
} | ||
|
||
.token.punctuation { | ||
color: #999 | ||
} | ||
|
||
.token.namespace { | ||
opacity: .7 | ||
} | ||
|
||
.token.boolean, .token.constant, .token.deleted, .token.number, .token.property, .token.symbol, .token.tag { | ||
color: #905 | ||
} | ||
|
||
.token.attr-name, .token.builtin, .token.char, .token.inserted, .token.selector, .token.string { | ||
color: #690 | ||
} | ||
|
||
.language-css .token.string, .style .token.string, .token.entity, .token.operator, .token.url { | ||
color: #9a6e3a; | ||
background: hsla(0,0%,100%,.5) | ||
} | ||
|
||
.token.atrule, .token.attr-value, .token.keyword { | ||
color: #07a | ||
} | ||
|
||
.token.class-name, .token.function { | ||
color: #dd4a68 | ||
} | ||
|
||
.token.important, .token.regex, .token.variable { | ||
color: #e90 | ||
} | ||
|
||
.token.bold, .token.important { | ||
font-weight: 700 | ||
} | ||
|
||
.token.italic { | ||
font-style: italic | ||
} | ||
|
||
.token.entity { | ||
cursor: help | ||
} | ||
|
||
|
||
.copy-code-button { | ||
opacity: 0; | ||
position: absolute; | ||
top: 0.8em; | ||
right: 0.5em; | ||
padding: 0.5em 1em; | ||
font-size: 14px; | ||
background-color: #0d0d0d; | ||
color: #fff; | ||
border: none; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
transition: .5s | ||
} | ||
|
||
pre:hover .copy-code-button { | ||
opacity: 1 | ||
} | ||
|
||
.copy-code-button:hover { | ||
background-color: #aaaaaa; | ||
color: #0d0d0d; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
@import "copyButton.css"; | ||
|
||
code[class*=language-], pre[class*=language-] { | ||
color: #f8f8f2; | ||
background: 0 0; | ||
text-shadow: 0 1px rgba(0,0,0,.3); | ||
font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; | ||
font-size: 1em; | ||
text-align: left; | ||
white-space: pre; | ||
word-spacing: normal; | ||
word-break: normal; | ||
word-wrap: normal; | ||
line-height: 1.5; | ||
-moz-tab-size: 4; | ||
-o-tab-size: 4; | ||
tab-size: 4; | ||
-webkit-hyphens: none; | ||
-moz-hyphens: none; | ||
-ms-hyphens: none; | ||
hyphens: none | ||
} | ||
*{ | ||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif | ||
} | ||
pre[class*=language-] { | ||
padding: 1em; | ||
margin: .5em 0; | ||
overflow: auto; | ||
border-radius: .3em | ||
} | ||
|
||
:not(pre) > code[class*=language-], pre[class*=language-] { | ||
background: #272822 | ||
} | ||
|
||
:not(pre) > code[class*=language-] { | ||
padding: .1em; | ||
border-radius: .3em; | ||
white-space: normal | ||
} | ||
|
||
.token.cdata, .token.comment, .token.doctype, .token.prolog { | ||
color: #8292a2 | ||
} | ||
|
||
.token.punctuation { | ||
color: #f8f8f2 | ||
} | ||
|
||
.token.namespace { | ||
opacity: .7 | ||
} | ||
|
||
.token.constant, .token.deleted, .token.property, .token.symbol, .token.tag { | ||
color: #f92672 | ||
} | ||
|
||
.token.boolean, .token.number { | ||
color: #ae81ff | ||
} | ||
|
||
.token.attr-name, .token.builtin, .token.char, .token.inserted, .token.selector, .token.string { | ||
color: #a6e22e | ||
} | ||
|
||
.language-css .token.string, .style .token.string, .token.entity, .token.operator, .token.url, .token.variable { | ||
color: #f8f8f2 | ||
} | ||
|
||
.token.atrule, .token.attr-value, .token.class-name, .token.function { | ||
color: #e6db74 | ||
} | ||
|
||
.token.keyword { | ||
color: #66d9ef | ||
} | ||
|
||
.token.important, .token.regex { | ||
color: #fd971f | ||
} | ||
|
||
.token.bold, .token.important { | ||
font-weight: 700 | ||
} | ||
|
||
.token.italic { | ||
font-style: italic | ||
} | ||
|
||
.token.entity { | ||
cursor: help | ||
} | ||
|
||
.copy-code-button { | ||
opacity: 0; | ||
position: absolute; | ||
top: 0.8em; | ||
right: 0.5em; | ||
padding: 0.5em 1em; | ||
font-size: 14px; | ||
background-color: #2e2f29; | ||
color: #fff; | ||
border: none; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
transition: .5s; | ||
} | ||
|
||
pre:hover .copy-code-button { | ||
opacity: 1 | ||
} | ||
|
||
.copy-code-button:hover { | ||
background-color: #fff; | ||
color: #2e2f29; | ||
} |