Swap out syntax highlighing library for one that's .NET Core compatible.

This commit is contained in:
Robert Marshall 2020-01-04 11:04:54 +00:00
parent edb1f99387
commit e77298ae54
3 changed files with 96 additions and 11 deletions

View file

@ -1,6 +1,6 @@
using System;
using Markdig;
using Markdig.SyntaxHighlighting;
using Pek.Markdig.HighlightJs;
using Website.Models;
namespace Website.ViewModels
@ -41,7 +41,7 @@ namespace Website.ViewModels
//.UseAdvancedExtensions()
.UseAutoLinks()
.UseSoftlineBreakAsHardlineBreak()
.UseSyntaxHighlighting()
.UseHighlightJs()
.Build();
public int Id { get; }

View file

@ -11,9 +11,9 @@
<PackageReference Include="dapper" Version="2.0.30" />
<PackageReference Include="dapper.contrib" Version="2.0.30" />
<PackageReference Include="markdig" Version="0.18.0" />
<PackageReference Include="Markdig.SyntaxHighlighting" Version="1.1.7" />
<PackageReference Include="mysqlconnector" Version="0.61.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Pek.Markdig.HighlightJs" Version="0.5.1" />
</ItemGroup>
<Target Name="BuildCss" BeforeTargets="Build">

View file

@ -1,18 +1,14 @@
@import "colours.less";
.editor-colors {
border: 4px solid #fff;
code {
background: #fff;
border-radius: 4px;
margin-bottom: 10px;
overflow: auto;
padding: 6px;
pre {
margin: 0;
tab-size: 4;
-moz-tab-size: 4;
}
margin: 0;
tab-size: 4;
-moz-tab-size: 4;
}
.image {
@ -62,3 +58,92 @@
background: @Grey-300;
}
}
/**
* Obsidian style
* ported by Alexander Marenin (http://github.com/ioncreature)
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #282b2e;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-selector-id {
color: #93c763;
}
.hljs-number {
color: #ffcd22;
}
.hljs {
color: #e0e2e4;
}
.hljs-attribute {
color: #668bb0;
}
.hljs-code,
.hljs-class .hljs-title,
.hljs-section {
color: white;
}
.hljs-regexp,
.hljs-link {
color: #d39745;
}
.hljs-meta {
color: #557182;
}
.hljs-tag,
.hljs-name,
.hljs-bullet,
.hljs-subst,
.hljs-emphasis,
.hljs-type,
.hljs-built_in,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-addition,
.hljs-variable,
.hljs-template-tag,
.hljs-template-variable {
color: #8cbbad;
}
.hljs-string,
.hljs-symbol {
color: #ec7600;
}
.hljs-comment,
.hljs-quote,
.hljs-deletion {
color: #818e96;
}
.hljs-selector-class {
color: #A082BD
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-doctag,
.hljs-title,
.hljs-section,
.hljs-type,
.hljs-name,
.hljs-strong {
font-weight: bold;
}