From 6917406101c93f51fbb11c481a292628a347e37d Mon Sep 17 00:00:00 2001 From: Oleksii Holub <1935960+Tyrrrz@users.noreply.github.com> Date: Mon, 6 Feb 2023 15:28:05 +0200 Subject: [PATCH] Simplify project structure --- DiscordChatExporter.Core/DiscordChatExporter.Core.csproj | 2 +- .../Exporting/{Writers => Csv}/CsvMessageWriter.cs | 4 ++-- .../MarkdownVisitors => Html}/HtmlMarkdownVisitor.cs | 2 +- .../Exporting/{Writers => Html}/HtmlMessageWriter.cs | 3 +-- .../Exporting/{Writers => }/Html/MessageExtensions.cs | 2 +- .../Exporting/{Writers => }/Html/MessageGroupTemplate.cshtml | 4 ---- .../Exporting/{Writers => }/Html/PostambleTemplate.cshtml | 5 +---- .../Exporting/{Writers => }/Html/PreambleTemplate.cshtml | 2 -- .../Exporting/{Writers => Json}/JsonMessageWriter.cs | 4 ++-- DiscordChatExporter.Core/Exporting/MessageExporter.cs | 5 ++++- .../Exporting/{Writers => }/MessageWriter.cs | 2 +- .../PlainTextMarkdownVisitor.cs | 2 +- .../{Writers => PlainText}/PlainTextMessageWriter.cs | 3 +-- 13 files changed, 16 insertions(+), 24 deletions(-) rename DiscordChatExporter.Core/Exporting/{Writers => Csv}/CsvMessageWriter.cs (96%) rename DiscordChatExporter.Core/Exporting/{Writers/MarkdownVisitors => Html}/HtmlMarkdownVisitor.cs (99%) rename DiscordChatExporter.Core/Exporting/{Writers => Html}/HtmlMessageWriter.cs (97%) rename DiscordChatExporter.Core/Exporting/{Writers => }/Html/MessageExtensions.cs (91%) rename DiscordChatExporter.Core/Exporting/{Writers => }/Html/MessageGroupTemplate.cshtml (99%) rename DiscordChatExporter.Core/Exporting/{Writers => }/Html/PostambleTemplate.cshtml (76%) rename DiscordChatExporter.Core/Exporting/{Writers => }/Html/PreambleTemplate.cshtml (99%) rename DiscordChatExporter.Core/Exporting/{Writers => Json}/JsonMessageWriter.cs (99%) rename DiscordChatExporter.Core/Exporting/{Writers => }/MessageWriter.cs (94%) rename DiscordChatExporter.Core/Exporting/{Writers/MarkdownVisitors => PlainText}/PlainTextMarkdownVisitor.cs (97%) rename DiscordChatExporter.Core/Exporting/{Writers => PlainText}/PlainTextMessageWriter.cs (98%) diff --git a/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj b/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj index 98f55bc..ada6941 100644 --- a/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj +++ b/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj @@ -14,7 +14,7 @@ - + \ No newline at end of file diff --git a/DiscordChatExporter.Core/Exporting/Writers/CsvMessageWriter.cs b/DiscordChatExporter.Core/Exporting/Csv/CsvMessageWriter.cs similarity index 96% rename from DiscordChatExporter.Core/Exporting/Writers/CsvMessageWriter.cs rename to DiscordChatExporter.Core/Exporting/Csv/CsvMessageWriter.cs index c91c087..96865e7 100644 --- a/DiscordChatExporter.Core/Exporting/Writers/CsvMessageWriter.cs +++ b/DiscordChatExporter.Core/Exporting/Csv/CsvMessageWriter.cs @@ -4,10 +4,10 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using DiscordChatExporter.Core.Discord.Data; -using DiscordChatExporter.Core.Exporting.Writers.MarkdownVisitors; +using DiscordChatExporter.Core.Exporting.PlainText; using DiscordChatExporter.Core.Utils.Extensions; -namespace DiscordChatExporter.Core.Exporting.Writers; +namespace DiscordChatExporter.Core.Exporting.Csv; internal partial class CsvMessageWriter : MessageWriter { diff --git a/DiscordChatExporter.Core/Exporting/Writers/MarkdownVisitors/HtmlMarkdownVisitor.cs b/DiscordChatExporter.Core/Exporting/Html/HtmlMarkdownVisitor.cs similarity index 99% rename from DiscordChatExporter.Core/Exporting/Writers/MarkdownVisitors/HtmlMarkdownVisitor.cs rename to DiscordChatExporter.Core/Exporting/Html/HtmlMarkdownVisitor.cs index 919c3c6..d90e759 100644 --- a/DiscordChatExporter.Core/Exporting/Writers/MarkdownVisitors/HtmlMarkdownVisitor.cs +++ b/DiscordChatExporter.Core/Exporting/Html/HtmlMarkdownVisitor.cs @@ -10,7 +10,7 @@ using DiscordChatExporter.Core.Markdown; using DiscordChatExporter.Core.Markdown.Parsing; using DiscordChatExporter.Core.Utils.Extensions; -namespace DiscordChatExporter.Core.Exporting.Writers.MarkdownVisitors; +namespace DiscordChatExporter.Core.Exporting.Html; internal partial class HtmlMarkdownVisitor : MarkdownVisitor { diff --git a/DiscordChatExporter.Core/Exporting/Writers/HtmlMessageWriter.cs b/DiscordChatExporter.Core/Exporting/Html/HtmlMessageWriter.cs similarity index 97% rename from DiscordChatExporter.Core/Exporting/Writers/HtmlMessageWriter.cs rename to DiscordChatExporter.Core/Exporting/Html/HtmlMessageWriter.cs index bc6cf77..c22975e 100644 --- a/DiscordChatExporter.Core/Exporting/Writers/HtmlMessageWriter.cs +++ b/DiscordChatExporter.Core/Exporting/Html/HtmlMessageWriter.cs @@ -5,10 +5,9 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using DiscordChatExporter.Core.Discord.Data; -using DiscordChatExporter.Core.Exporting.Writers.Html; using WebMarkupMin.Core; -namespace DiscordChatExporter.Core.Exporting.Writers; +namespace DiscordChatExporter.Core.Exporting.Html; internal class HtmlMessageWriter : MessageWriter { diff --git a/DiscordChatExporter.Core/Exporting/Writers/Html/MessageExtensions.cs b/DiscordChatExporter.Core/Exporting/Html/MessageExtensions.cs similarity index 91% rename from DiscordChatExporter.Core/Exporting/Writers/Html/MessageExtensions.cs rename to DiscordChatExporter.Core/Exporting/Html/MessageExtensions.cs index 965f98a..f970b79 100644 --- a/DiscordChatExporter.Core/Exporting/Writers/Html/MessageExtensions.cs +++ b/DiscordChatExporter.Core/Exporting/Html/MessageExtensions.cs @@ -2,7 +2,7 @@ using System; using DiscordChatExporter.Core.Discord.Data; using DiscordChatExporter.Core.Discord.Data.Embeds; -namespace DiscordChatExporter.Core.Exporting.Writers.Html; +namespace DiscordChatExporter.Core.Exporting.Html; internal static class MessageExtensions { diff --git a/DiscordChatExporter.Core/Exporting/Writers/Html/MessageGroupTemplate.cshtml b/DiscordChatExporter.Core/Exporting/Html/MessageGroupTemplate.cshtml similarity index 99% rename from DiscordChatExporter.Core/Exporting/Writers/Html/MessageGroupTemplate.cshtml rename to DiscordChatExporter.Core/Exporting/Html/MessageGroupTemplate.cshtml index 051cc66..bda2a70 100644 --- a/DiscordChatExporter.Core/Exporting/Writers/Html/MessageGroupTemplate.cshtml +++ b/DiscordChatExporter.Core/Exporting/Html/MessageGroupTemplate.cshtml @@ -1,13 +1,9 @@ @using System @using System.Collections.Generic @using System.Linq -@using System.Threading @using System.Threading.Tasks @using DiscordChatExporter.Core.Discord.Data @using DiscordChatExporter.Core.Discord.Data.Embeds -@using DiscordChatExporter.Core.Exporting -@using DiscordChatExporter.Core.Exporting.Writers.Html -@using DiscordChatExporter.Core.Exporting.Writers.MarkdownVisitors @using DiscordChatExporter.Core.Utils.Extensions @inherits RazorBlade.HtmlTemplate diff --git a/DiscordChatExporter.Core/Exporting/Writers/Html/PostambleTemplate.cshtml b/DiscordChatExporter.Core/Exporting/Html/PostambleTemplate.cshtml similarity index 76% rename from DiscordChatExporter.Core/Exporting/Writers/Html/PostambleTemplate.cshtml rename to DiscordChatExporter.Core/Exporting/Html/PostambleTemplate.cshtml index 68ddcf8..60ff8db 100644 --- a/DiscordChatExporter.Core/Exporting/Writers/Html/PostambleTemplate.cshtml +++ b/DiscordChatExporter.Core/Exporting/Html/PostambleTemplate.cshtml @@ -1,7 +1,4 @@ -@using System.Threading -@using DiscordChatExporter.Core.Exporting - -@inherits RazorBlade.HtmlTemplate +@inherits RazorBlade.HtmlTemplate @functions { public required ExportContext ExportContext { get; init; } diff --git a/DiscordChatExporter.Core/Exporting/Writers/Html/PreambleTemplate.cshtml b/DiscordChatExporter.Core/Exporting/Html/PreambleTemplate.cshtml similarity index 99% rename from DiscordChatExporter.Core/Exporting/Writers/Html/PreambleTemplate.cshtml rename to DiscordChatExporter.Core/Exporting/Html/PreambleTemplate.cshtml index 7108858..730caca 100644 --- a/DiscordChatExporter.Core/Exporting/Writers/Html/PreambleTemplate.cshtml +++ b/DiscordChatExporter.Core/Exporting/Html/PreambleTemplate.cshtml @@ -1,8 +1,6 @@ @using System @using System.Threading @using System.Threading.Tasks -@using DiscordChatExporter.Core.Exporting -@using DiscordChatExporter.Core.Exporting.Writers.MarkdownVisitors @inherits RazorBlade.HtmlTemplate diff --git a/DiscordChatExporter.Core/Exporting/Writers/JsonMessageWriter.cs b/DiscordChatExporter.Core/Exporting/Json/JsonMessageWriter.cs similarity index 99% rename from DiscordChatExporter.Core/Exporting/Writers/JsonMessageWriter.cs rename to DiscordChatExporter.Core/Exporting/Json/JsonMessageWriter.cs index 9d9a125..150a87e 100644 --- a/DiscordChatExporter.Core/Exporting/Writers/JsonMessageWriter.cs +++ b/DiscordChatExporter.Core/Exporting/Json/JsonMessageWriter.cs @@ -5,11 +5,11 @@ using System.Threading; using System.Threading.Tasks; using DiscordChatExporter.Core.Discord.Data; using DiscordChatExporter.Core.Discord.Data.Embeds; -using DiscordChatExporter.Core.Exporting.Writers.MarkdownVisitors; +using DiscordChatExporter.Core.Exporting.PlainText; using DiscordChatExporter.Core.Utils.Extensions; using JsonExtensions.Writing; -namespace DiscordChatExporter.Core.Exporting.Writers; +namespace DiscordChatExporter.Core.Exporting.Json; internal class JsonMessageWriter : MessageWriter { diff --git a/DiscordChatExporter.Core/Exporting/MessageExporter.cs b/DiscordChatExporter.Core/Exporting/MessageExporter.cs index c525f31..a975d48 100644 --- a/DiscordChatExporter.Core/Exporting/MessageExporter.cs +++ b/DiscordChatExporter.Core/Exporting/MessageExporter.cs @@ -3,7 +3,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; using DiscordChatExporter.Core.Discord.Data; -using DiscordChatExporter.Core.Exporting.Writers; +using DiscordChatExporter.Core.Exporting.Csv; +using DiscordChatExporter.Core.Exporting.Html; +using DiscordChatExporter.Core.Exporting.Json; +using DiscordChatExporter.Core.Exporting.PlainText; namespace DiscordChatExporter.Core.Exporting; diff --git a/DiscordChatExporter.Core/Exporting/Writers/MessageWriter.cs b/DiscordChatExporter.Core/Exporting/MessageWriter.cs similarity index 94% rename from DiscordChatExporter.Core/Exporting/Writers/MessageWriter.cs rename to DiscordChatExporter.Core/Exporting/MessageWriter.cs index 5e0b7b5..9031142 100644 --- a/DiscordChatExporter.Core/Exporting/Writers/MessageWriter.cs +++ b/DiscordChatExporter.Core/Exporting/MessageWriter.cs @@ -4,7 +4,7 @@ using System.Threading; using System.Threading.Tasks; using DiscordChatExporter.Core.Discord.Data; -namespace DiscordChatExporter.Core.Exporting.Writers; +namespace DiscordChatExporter.Core.Exporting; internal abstract class MessageWriter : IAsyncDisposable { diff --git a/DiscordChatExporter.Core/Exporting/Writers/MarkdownVisitors/PlainTextMarkdownVisitor.cs b/DiscordChatExporter.Core/Exporting/PlainText/PlainTextMarkdownVisitor.cs similarity index 97% rename from DiscordChatExporter.Core/Exporting/Writers/MarkdownVisitors/PlainTextMarkdownVisitor.cs rename to DiscordChatExporter.Core/Exporting/PlainText/PlainTextMarkdownVisitor.cs index 5224470..2e956b4 100644 --- a/DiscordChatExporter.Core/Exporting/Writers/MarkdownVisitors/PlainTextMarkdownVisitor.cs +++ b/DiscordChatExporter.Core/Exporting/PlainText/PlainTextMarkdownVisitor.cs @@ -5,7 +5,7 @@ using DiscordChatExporter.Core.Markdown; using DiscordChatExporter.Core.Markdown.Parsing; using DiscordChatExporter.Core.Utils.Extensions; -namespace DiscordChatExporter.Core.Exporting.Writers.MarkdownVisitors; +namespace DiscordChatExporter.Core.Exporting.PlainText; internal partial class PlainTextMarkdownVisitor : MarkdownVisitor { diff --git a/DiscordChatExporter.Core/Exporting/Writers/PlainTextMessageWriter.cs b/DiscordChatExporter.Core/Exporting/PlainText/PlainTextMessageWriter.cs similarity index 98% rename from DiscordChatExporter.Core/Exporting/Writers/PlainTextMessageWriter.cs rename to DiscordChatExporter.Core/Exporting/PlainText/PlainTextMessageWriter.cs index 4e97bec..ec6247e 100644 --- a/DiscordChatExporter.Core/Exporting/Writers/PlainTextMessageWriter.cs +++ b/DiscordChatExporter.Core/Exporting/PlainText/PlainTextMessageWriter.cs @@ -5,9 +5,8 @@ using System.Threading; using System.Threading.Tasks; using DiscordChatExporter.Core.Discord.Data; using DiscordChatExporter.Core.Discord.Data.Embeds; -using DiscordChatExporter.Core.Exporting.Writers.MarkdownVisitors; -namespace DiscordChatExporter.Core.Exporting.Writers; +namespace DiscordChatExporter.Core.Exporting.PlainText; internal class PlainTextMessageWriter : MessageWriter {