From 99ff3124c3bd079e19bc09489fbc4766c02c00d7 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Sun, 5 May 2024 02:26:50 +0100 Subject: [PATCH] refactor: move SmartFormat extensions to separate project --- .../DateFormatter.cs | 2 +- .../MarkdownFormatter.cs | 3 ++- .../OliverBooth.Extensions.SmartFormat.csproj | 19 +++++++++++++++++++ OliverBooth.sln | 6 ++++++ OliverBooth/OliverBooth.csproj | 2 +- OliverBooth/Services/TemplateService.cs | 2 +- 6 files changed, 30 insertions(+), 4 deletions(-) rename {OliverBooth/Formatting => OliverBooth.Extensions.SmartFormat}/DateFormatter.cs (95%) rename {OliverBooth/Formatting => OliverBooth.Extensions.SmartFormat}/MarkdownFormatter.cs (92%) create mode 100644 OliverBooth.Extensions.SmartFormat/OliverBooth.Extensions.SmartFormat.csproj diff --git a/OliverBooth/Formatting/DateFormatter.cs b/OliverBooth.Extensions.SmartFormat/DateFormatter.cs similarity index 95% rename from OliverBooth/Formatting/DateFormatter.cs rename to OliverBooth.Extensions.SmartFormat/DateFormatter.cs index 6109cab..7b98f26 100644 --- a/OliverBooth/Formatting/DateFormatter.cs +++ b/OliverBooth.Extensions.SmartFormat/DateFormatter.cs @@ -1,7 +1,7 @@ using System.Globalization; using SmartFormat.Core.Extensions; -namespace OliverBooth.Formatting; +namespace OliverBooth.Extensions.SmartFormat; /// /// Represents a SmartFormat formatter that formats a date. diff --git a/OliverBooth/Formatting/MarkdownFormatter.cs b/OliverBooth.Extensions.SmartFormat/MarkdownFormatter.cs similarity index 92% rename from OliverBooth/Formatting/MarkdownFormatter.cs rename to OliverBooth.Extensions.SmartFormat/MarkdownFormatter.cs index c682e2c..2f38c96 100644 --- a/OliverBooth/Formatting/MarkdownFormatter.cs +++ b/OliverBooth.Extensions.SmartFormat/MarkdownFormatter.cs @@ -1,7 +1,8 @@ using Markdig; +using Microsoft.Extensions.DependencyInjection; using SmartFormat.Core.Extensions; -namespace OliverBooth.Formatting; +namespace OliverBooth.Extensions.SmartFormat; /// /// Represents a SmartFormat formatter that formats markdown. diff --git a/OliverBooth.Extensions.SmartFormat/OliverBooth.Extensions.SmartFormat.csproj b/OliverBooth.Extensions.SmartFormat/OliverBooth.Extensions.SmartFormat.csproj new file mode 100644 index 0000000..af76520 --- /dev/null +++ b/OliverBooth.Extensions.SmartFormat/OliverBooth.Extensions.SmartFormat.csproj @@ -0,0 +1,19 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + + + diff --git a/OliverBooth.sln b/OliverBooth.sln index ea184df..1d052f5 100644 --- a/OliverBooth.sln +++ b/OliverBooth.sln @@ -17,6 +17,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OliverBooth.Extensions.Mark EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OliverBooth.Common", "OliverBooth.Common\OliverBooth.Common.csproj", "{AD231E0F-FAED-4661-963F-EB22F858E148}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OliverBooth.Extensions.SmartFormat", "OliverBooth.Extensions.SmartFormat\OliverBooth.Extensions.SmartFormat.csproj", "{9D56FA9B-B95B-460D-8745-41AABAA8BF61}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -35,6 +37,10 @@ Global {AD231E0F-FAED-4661-963F-EB22F858E148}.Debug|Any CPU.Build.0 = Debug|Any CPU {AD231E0F-FAED-4661-963F-EB22F858E148}.Release|Any CPU.ActiveCfg = Release|Any CPU {AD231E0F-FAED-4661-963F-EB22F858E148}.Release|Any CPU.Build.0 = Release|Any CPU + {9D56FA9B-B95B-460D-8745-41AABAA8BF61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9D56FA9B-B95B-460D-8745-41AABAA8BF61}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9D56FA9B-B95B-460D-8745-41AABAA8BF61}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9D56FA9B-B95B-460D-8745-41AABAA8BF61}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution EndGlobalSection diff --git a/OliverBooth/OliverBooth.csproj b/OliverBooth/OliverBooth.csproj index 463e9d9..b00cc91 100644 --- a/OliverBooth/OliverBooth.csproj +++ b/OliverBooth/OliverBooth.csproj @@ -42,7 +42,6 @@ - @@ -50,6 +49,7 @@ + diff --git a/OliverBooth/Services/TemplateService.cs b/OliverBooth/Services/TemplateService.cs index 90bc47a..091da99 100644 --- a/OliverBooth/Services/TemplateService.cs +++ b/OliverBooth/Services/TemplateService.cs @@ -5,7 +5,7 @@ using OliverBooth.Common.Data.Web; using OliverBooth.Data.Web; using OliverBooth.Extensions.Markdig.Markdown.Template; using OliverBooth.Extensions.Markdig.Services; -using OliverBooth.Formatting; +using OliverBooth.Extensions.SmartFormat; using OliverBooth.Markdown.Template; using SmartFormat; using SmartFormat.Extensions;