Compare commits

...

3 Commits

Author SHA1 Message Date
Oleksii Holub 77bf32aa5a Update version 2019-03-14 16:36:55 +02:00
Oleksii Holub ac2b450892 Retry on any 5xx HTTP response in DataService
Closes #157
2019-03-14 16:30:27 +02:00
Oleksii Holub 4046fd0ad9 [HTML] Add syntax highlighting via Highlight.js
Closes #138
2019-03-14 16:02:39 +02:00
9 changed files with 31 additions and 11 deletions
+5
View File
@@ -1,3 +1,8 @@
### v2.11 (14-Mar-2019)
- [HTML] Added syntax highlighting for multiline code blocks via Highlight.js.
- Added retry policy for all 5xx status codes to prevent random crashes.
### v2.10.2 (10-Mar-2019) ### v2.10.2 (10-Mar-2019)
- [HTML] Updated message grouping algorithm to make it the same as in Discord. Removed "message group limit" setting and parameter. - [HTML] Updated message grouping algorithm to make it the same as in Discord. Removed "message group limit" setting and parameter.
@@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net461</TargetFramework> <TargetFramework>net461</TargetFramework>
<Version>2.10.2</Version> <Version>2.11</Version>
<Company>Tyrrrz</Company> <Company>Tyrrrz</Company>
<Copyright>Copyright (c) Alexey Golub</Copyright> <Copyright>Copyright (c) Alexey Golub</Copyright>
<ApplicationIcon>..\favicon.ico</ApplicationIcon> <ApplicationIcon>..\favicon.ico</ApplicationIcon>
@@ -1,2 +1,3 @@
{{~ ThemeStyleSheet = include "HtmlDark.Theme.css" ~}} {{~ ThemeStyleSheet = include "HtmlDark.Theme.css" ~}}
{{~ HighlightJsStyleName = "solarized-dark" ~}}
{{~ include "HtmlShared.Main.html" ~}} {{~ include "HtmlShared.Main.html" ~}}
@@ -14,12 +14,12 @@ a {
} }
.pre { .pre {
background-color: #2f3136; background-color: #2f3136 !important;
} }
.pre--multiline { .pre--multiline {
border-color: #282b30; border-color: #282b30 !important;
color: #839496; color: #839496 !important;
} }
.mention { .mention {
@@ -1,2 +1,3 @@
{{~ ThemeStyleSheet = include "HtmlLight.Theme.css" ~}} {{~ ThemeStyleSheet = include "HtmlLight.Theme.css" ~}}
{{~ HighlightJsStyleName = "solarized-light" ~}}
{{~ include "HtmlShared.Main.html" ~}} {{~ include "HtmlShared.Main.html" ~}}
@@ -14,12 +14,12 @@ a {
} }
.pre { .pre {
background-color: #f9f9f9; background-color: #f9f9f9 !important;
} }
.pre--multiline { .pre--multiline {
border-color: #f3f3f3; border-color: #f3f3f3 !important;
color: #657b83; color: #657b83 !important;
} }
.mention { .mention {
@@ -2,15 +2,29 @@
<html lang="en"> <html lang="en">
<head> <head>
{{~ # Metadata ~}}
<title>{{ Model.Guild.Name | html.escape }} - {{ Model.Channel.Name | html.escape }}</title> <title>{{ Model.Guild.Name | html.escape }} - {{ Model.Channel.Name | html.escape }}</title>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
{{~ # Styles ~}}
<style> <style>
{{ include "HtmlShared.Main.css" }} {{ include "HtmlShared.Main.css" }}
</style> </style>
<style> <style>
{{ ThemeStyleSheet }} {{ ThemeStyleSheet }}
</style> </style>
{{~ # Syntax highlighting ~}}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/{{HighlightJsStyleName}}.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.pre--multiline').forEach((block) => {
hljs.highlightBlock(block);
});
});
</script>
</head> </head>
<body> <body>
@@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -23,7 +22,7 @@ namespace DiscordChatExporter.Core.Services
{ {
// Create retry policy // Create retry policy
var retry = Retry.Create() var retry = Retry.Create()
.Catch<HttpErrorStatusCodeException>(false, e => e.StatusCode == HttpStatusCode.ServiceUnavailable) .Catch<HttpErrorStatusCodeException>(false, e => (int) e.StatusCode >= 500)
.Catch<HttpErrorStatusCodeException>(false, e => (int) e.StatusCode == 429) .Catch<HttpErrorStatusCodeException>(false, e => (int) e.StatusCode == 429)
.WithMaxTryCount(10) .WithMaxTryCount(10)
.WithDelay(TimeSpan.FromSeconds(0.4)); .WithDelay(TimeSpan.FromSeconds(0.4));
@@ -3,5 +3,5 @@
[assembly: AssemblyTitle("DiscordChatExporter")] [assembly: AssemblyTitle("DiscordChatExporter")]
[assembly: AssemblyCompany("Tyrrrz")] [assembly: AssemblyCompany("Tyrrrz")]
[assembly: AssemblyCopyright("Copyright (c) Alexey Golub")] [assembly: AssemblyCopyright("Copyright (c) Alexey Golub")]
[assembly: AssemblyVersion("2.10.2")] [assembly: AssemblyVersion("2.11")]
[assembly: AssemblyFileVersion("2.10.2")] [assembly: AssemblyFileVersion("2.11")]