Skip to content

Commit

Permalink
Merge branch 'release/v04.02.00'
Browse files Browse the repository at this point in the history
  • Loading branch information
tvatavuk committed Feb 20, 2023
2 parents e7ecaa1 + 6c43ce0 commit 1e85eff
Show file tree
Hide file tree
Showing 167 changed files with 8,209 additions and 1,715 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace ToSic.Razor.Blade
{
[PrivateApi("Hide implementation")]
public partial class HtmlTagServiceImplementation: IHtmlTagService
public partial class HtmlTagsServiceImplementation: IHtmlTagsService
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand All @@ -24,7 +24,7 @@
// ReSharper disable once CheckNamespace
namespace ToSic.Razor.Blade
{
public partial class HtmlTagServiceImplementation
public partial class HtmlTagsServiceImplementation
{

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace ToSic.Razor.Blade
{
public partial class HtmlTagServiceImplementation
public partial class HtmlTagsServiceImplementation
{
/// <inheritdoc />
public Comment Comment(string content = null) => new Comment(content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace ToSic.Razor.Blade
{
public partial class HtmlTagServiceImplementation
public partial class HtmlTagsServiceImplementation
{
/// <inheritdoc />
public MetaOg MetaOg(string property = null, string content = null) => new MetaOg(property, content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/// var tagOldWithId = tagOld.Id(...).Style(...).Class(...);
/// // now tagOld and tagOldWithId are both the same objects with all changes applied
///
/// // New API - assumes tagSvc is IHtmlTagService
/// // New API - assumes tagSvc is IHtmlTagsService
/// // these two objects will NOT be the same
/// var tag = tagSvc.Div();
/// var tagWithId = tag.Id(...).Style(...).Class(...);
Expand All @@ -30,7 +30,7 @@
/// * Introduced in v4.0
/// * It intentionally uses the term "Service" in the end (different from <see cref="IScrub"/> to prevent confusion with <see cref="IHtmlTag"/>.
/// </remarks>
public partial interface IHtmlTagService
public partial interface IHtmlTagsService
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand All @@ -24,7 +24,7 @@
// ReSharper disable once CheckNamespace
namespace ToSic.Razor.Blade
{
public partial interface IHtmlTagService
public partial interface IHtmlTagsService
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace ToSic.Razor.Blade
{
public partial interface IHtmlTagService
public partial interface IHtmlTagsService
{
/// <summary>
/// Create a HTML comment with something inside.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace ToSic.Razor.Blade
{
public partial interface IHtmlTagService
public partial interface IHtmlTagsService
{
/// <summary>
/// Generate a open-graph Meta tag.
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/Html5/GeneratedFormatting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/Html5/GeneratedForms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/Html5/GeneratedFrames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/Html5/GeneratedHead.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/Html5/GeneratedImages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/Html5/GeneratedLinks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/Html5/GeneratedMedia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/Html5/GeneratedScripts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/Html5/GeneratedSemantics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/Html5/GeneratedSimple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/Html5/GeneratedTables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/Html5/Tag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// ****
// This is auto-generated code - don't modify
// Re-run the generation program to recreate
// Created 20.2.2023. 11:37
// Created 20.2.2023. 13:35
//
// Each tag and attributes of it prepare code, and they return an object of the same type again
// to allow fluid chaining of the commands
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/Razor.Blade.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net472;net6.0;net7.0</TargetFrameworks>
<RootNamespace>ToSic.Razor</RootNamespace>
<Version>04.01.01</Version>
<Version>04.02.00</Version>
<AssemblyName>ToSic.Razor</AssemblyName>
<PackageId>ToSic.Razor</PackageId>
<Authors>ToSic.Razor</Authors>
Expand Down
1 change: 1 addition & 0 deletions Razor.Blade/Razor.Blade.csproj.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=blade_005Cdic/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=blade_005Chtmlpage/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=blade_005Chtmltagservice/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=blade_005Chtmltagsservice/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=blade_005Chtmltags_005Cbasic/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=blade_005Chtmltags_005Ccore/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=blade_005Chtmltags_005Cformatting/@EntryIndexedValue">True</s:Boolean>
Expand Down
2 changes: 1 addition & 1 deletion Razor.Blade/StartUp/StartUp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class StartUp
public static IServiceCollection AddRazorBlade(this IServiceCollection services)
{
services.TryAddTransient<IScrub, ScrubImplementation>();
services.TryAddTransient<IHtmlTagService, HtmlTagServiceImplementation>();
services.TryAddTransient<IHtmlTagsService, HtmlTagsServiceImplementation>();
return services;
}

Expand Down
22 changes: 11 additions & 11 deletions Source-Code-Generator/Generator/CsFileGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class CsFileGenerator
public const string GeneratedTargetPath = @"C:\Projects\razor-blade\Razor.Blade\Html5\";


public const string PathForTagService = @"C:\Projects\razor-blade\Razor.Blade\Blade\HtmlTagService\";
public const string PathForTagService = @"C:\Projects\razor-blade\Razor.Blade\Blade\HtmlTagsService\";

public static void GenerateFormatting()
{
Expand All @@ -33,17 +33,17 @@ public static void GenerateFormatting()
var qaFile = GeneratedTargetPath + specs.FileName;
ReplaceFile(qaFile, quickAccess);

// Generate HtmlTagService
// Generate HtmlTagsService
specs = Templates.HtmlTagsImplementation;
var htmlTagService = GenerateHtmlTagService(specs);
var HtmlTagsService = GenerateHtmlTagsService(specs);
var htFile = PathForTagService + specs.FileName;
ReplaceFile(htFile, htmlTagService);
ReplaceFile(htFile, HtmlTagsService);

// Generate IHtmlTagService
// Generate IHtmlTagsService
specs = Templates.IHtmlTags;
htmlTagService = GenerateHtmlTagServiceInterface(specs);
HtmlTagsService = GenerateHtmlTagsServiceInterface(specs);
htFile = PathForTagService + Templates.IHtmlTags.FileName;
ReplaceFile(htFile, htmlTagService);
ReplaceFile(htFile, HtmlTagsService);
}

/// <summary>
Expand Down Expand Up @@ -81,15 +81,15 @@ private static string GenerateQuickAccess(CodeFileSpecs specs)
var template = specs.Wrapper.Replace("{Contents}", string.Join("\n", list));
return template;
}
private static string GenerateHtmlTagService(CodeFileSpecs specs)
private static string GenerateHtmlTagsService(CodeFileSpecs specs)
{
var list = CommandsList().Select(c => c.HtmlTagServiceCode);
var list = CommandsList().Select(c => c.HtmlTagsServiceCode);
var template = specs.Wrapper.Replace("{Contents}", string.Join("\n", list));
return template;
}
private static string GenerateHtmlTagServiceInterface(CodeFileSpecs specs)
private static string GenerateHtmlTagsServiceInterface(CodeFileSpecs specs)
{
var list = CommandsList().Select(c => c.HtmlTagServiceInterfaceCode);
var list = CommandsList().Select(c => c.HtmlTagsServiceInterfaceCode);
var template = specs.Wrapper.Replace("{Contents}", string.Join("\n", list));
return template;
}
Expand Down
8 changes: 4 additions & 4 deletions Source-Code-Generator/Generator/Templates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ public static partial class Tag

public static CodeFileSpecs HtmlTagsImplementation = new CodeFileSpecs
{
FileName = "HtmlTagServiceImplementation_Generated.cs",
FileName = "HtmlTagsServiceImplementation_Generated.cs",
Wrapper = Intro + @"
// ReSharper disable once CheckNamespace
namespace ToSic.Razor.Blade
{
public partial class HtmlTagServiceImplementation
public partial class HtmlTagsServiceImplementation
{
{Contents}
}
Expand All @@ -76,12 +76,12 @@ public partial class HtmlTagServiceImplementation

public static CodeFileSpecs IHtmlTags => new CodeFileSpecs
{
FileName = "IHtmlTagService_Generated.cs",
FileName = "IHtmlTagsService_Generated.cs",
Wrapper = Intro + @"
// ReSharper disable once CheckNamespace
namespace ToSic.Razor.Blade
{
public partial interface IHtmlTagService
public partial interface IHtmlTagsService
{
{Contents}
}
Expand Down
6 changes: 3 additions & 3 deletions Source-Code-Generator/Parts/TagCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ public string Comment(string name = null) => $@"

#endregion

#region HtmlTagService & Interface
#region HtmlTagsService & Interface

public string HtmlTagServiceCode => $@"
public string HtmlTagsServiceCode => $@"
/// <inheritdoc />
public {ClassName} {ClassName}(params object[] content) => new {ClassName}(content);";

public string HtmlTagServiceInterfaceCode => $@"{Comment(ContentParamName)}
public string HtmlTagsServiceInterfaceCode => $@"{Comment(ContentParamName)}
/// <code>
/// // This assumes that `tagSvc` was previously retrieved from dependency injection
/// var {ClassName.ToLower()} = tagSvc.{ClassName}();{(
Expand Down
4 changes: 2 additions & 2 deletions ToSic.Razor.Dnn/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("04.01.01.00")]
[assembly: AssemblyFileVersion("04.01.01.00")]
[assembly: AssemblyVersion("04.02.00.00")]
[assembly: AssemblyFileVersion("04.02.00.00")]
2 changes: 1 addition & 1 deletion ToSic.Razor.Dnn/ToSic_Razor_Blade_Dnn.dnn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="ToSic.RazorBlade" type="Library" version="04.01.01">
<package name="ToSic.RazorBlade" type="Library" version="04.02.00">
<friendlyName>2sic RazorBlade</friendlyName>
<description>2sic RazorBlade</description>
<iconFile>icon.png</iconFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
namespace ToSic.Razor.Blade.Tests
{
[TestClass()]
public class HtmlTagServiceImplementationTests : TagTestBase
public class HtmlTagsServiceImplementationTests : TagTestBase
{
private readonly HtmlTagServiceImplementation htmlTagService = new HtmlTagServiceImplementation();
private readonly HtmlTagsServiceImplementation HtmlTagsService = new HtmlTagsServiceImplementation();

[TestMethod()]
public void H1Test()
{
Is("<h1></h1>", htmlTagService.H1());
Is("<h1>content</h1>", htmlTagService.H1("content"));
Is("<h1></h1>", HtmlTagsService.H1());
Is("<h1>content</h1>", HtmlTagsService.H1("content"));
}
}
}
2 changes: 1 addition & 1 deletion docs/api/ToSic.Razor.Blade.IHtmlTag.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<a href="ToSic.Razor.Blade.IHtmlTag.html" title="IHtmlTag" class="active">IHtmlTag</a>
</li>
<li class="">
<a href="ToSic.Razor.Blade.IHtmlTagService.html" title="IHtmlTagService" class="">IHtmlTagService</a>
<a href="ToSic.Razor.Blade.IHtmlTagsService.html" title="IHtmlTagsService" class="">IHtmlTagsService</a>
</li>
<li class="">
<a href="ToSic.Razor.Blade.IScrub.html" title="IScrub" class="">IScrub</a>
Expand Down
Loading

0 comments on commit 1e85eff

Please sign in to comment.