Skip to content

Commit 81509b4

Browse files
authored
Add Example WebAssembly based on Abies (#127)
* Example for Abies * css * className * . * more tests * gh * destination_dir: Handlebars.Net.Helpers * language="javascript" * <base href="."> * src="abies.js" * trigger * no dest * 🔺
1 parent 917da2c commit 81509b4

File tree

15 files changed

+730
-3
lines changed

15 files changed

+730
-3
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build and Deploy AbiesWebAssembly
2+
3+
on:
4+
push:
5+
branches:
6+
- example-Abies
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: '9.0.x'
20+
21+
- name: Restore Dependencies
22+
run: dotnet restore ./examples/AbiesWebAssembly/AbiesWebAssembly.csproj
23+
24+
- name: Build Project
25+
run: dotnet publish ./examples/AbiesWebAssembly/AbiesWebAssembly.csproj -c Release -o build
26+
27+
- name: Deploy to GitHub Pages
28+
uses: peaceiris/actions-gh-pages@v4
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
publish_dir: ./build/wwwroot
32+
# destination_dir: Handlebars.Net.Helpers

Handlebars.Net.Helpers.sln

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorAppWebAssembly", "exa
5151
EndProject
5252
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Actions", "GitHub Actions", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
5353
ProjectSection(SolutionItems) = preProject
54+
.github\workflows\BuildDeployAbiesWebAssembly.yml = .github\workflows\BuildDeployAbiesWebAssembly.yml
5455
.github\workflows\CreateRelease.yml = .github\workflows\CreateRelease.yml
5556
EndProjectSection
5657
EndProject
58+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbiesWebAssembly", "examples\AbiesWebAssembly\AbiesWebAssembly.csproj", "{BC14E557-DA32-DA21-BED6-45EE6D296EA3}"
59+
EndProject
5760
Global
5861
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5962
Debug|Any CPU = Debug|Any CPU
@@ -108,6 +111,10 @@ Global
108111
{F3AD9D4E-CA0D-4FFE-87D3-27974BECC5BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
109112
{F3AD9D4E-CA0D-4FFE-87D3-27974BECC5BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
110113
{F3AD9D4E-CA0D-4FFE-87D3-27974BECC5BD}.Release|Any CPU.Build.0 = Release|Any CPU
114+
{BC14E557-DA32-DA21-BED6-45EE6D296EA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
115+
{BC14E557-DA32-DA21-BED6-45EE6D296EA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
116+
{BC14E557-DA32-DA21-BED6-45EE6D296EA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
117+
{BC14E557-DA32-DA21-BED6-45EE6D296EA3}.Release|Any CPU.Build.0 = Release|Any CPU
111118
EndGlobalSection
112119
GlobalSection(SolutionProperties) = preSolution
113120
HideSolutionNode = FALSE
@@ -127,6 +134,7 @@ Global
127134
{E9A5CF6C-544C-4D1C-8AAD-EF4144FF7E9D} = {BA564CB5-1908-41F9-A32A-3535BBE0E8C6}
128135
{F3AD9D4E-CA0D-4FFE-87D3-27974BECC5BD} = {845A8FA6-E56E-4BB4-AD92-29093BB2CA09}
129136
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {01DFE66D-E850-4ADC-A0FC-A3A13B896CDA}
137+
{BC14E557-DA32-DA21-BED6-45EE6D296EA3} = {845A8FA6-E56E-4BB4-AD92-29093BB2CA09}
130138
EndGlobalSection
131139
GlobalSection(ExtensibilityGlobals) = postSolution
132140
SolutionGuid = {FC1E6DF8-EC39-439B-ABF0-EE3786C5C0F6}

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Handlebars.Net.Helpers
1+
# Handlebars.Net.Helpers
22
Several helpers which can be used for [Handlebars.Net](https://github.com/rexm/Handlebars.Net)
33

44
## Project
@@ -129,13 +129,14 @@ The following default built-in helpers are available:
129129
- [Dictionary](https://github.com/StefH/Handlebars.Net.Helpers/wiki/Dictionary)
130130
- [Constants](https://github.com/StefH/Handlebars.Net.Helpers/wiki/Constants)
131131
- [Enumerable](https://github.com/StefH/Handlebars.Net.Helpers/wiki/Enumerable)
132+
- [Environment](https://github.com/StefH/Handlebars.Net.Helpers/wiki/Environment) [🔺](#a-environmenthelpers)
132133
- [Math](https://github.com/StefH/Handlebars.Net.Helpers/wiki/Math)
133134
- [Regex](https://github.com/StefH/Handlebars.Net.Helpers/wiki/Regex)
134135
- [String](https://github.com/StefH/Handlebars.Net.Helpers/wiki/String)
135136
- [Url](https://github.com/StefH/Handlebars.Net.Helpers/wiki/Url)
136137

137-
And the following additonal helpers are available
138-
- [DynamicLinq](https://github.com/Handlebars-Net/Handlebars.Net.Helpers/wiki/DynamicLinq)
138+
And the following additonal helpers are available:
139+
- [DynamicLinq](https://github.com/Handlebars-Net/Handlebars.Net.Helpers/wiki/DynamicLinq) [🔺](#b-systemlinqdynamiccore)
139140
- [Humanizer](https://github.com/Handlebars-Net/Handlebars.Net.Helpers/wiki/Humanizer)
140141
- [Json](https://github.com/Handlebars-Net/Handlebars.Net.Helpers/wiki/Json)
141142
- [Random](https://github.com/Handlebars-Net/Handlebars.Net.Helpers/wiki/Random)
@@ -150,3 +151,8 @@ And the following additonal helpers are available
150151
- Some code based on https://www.30secondsofcode.org/c-sharp/t/string/p/1
151152
- Some documentation based on https://github.com/arinet/HandlebarDocs
152153
- SimpleJson copied from (https://github.com/facebook-csharp-sdk/simple-json)
154+
155+
156+
## Example
157+
- Static WebAssembly WebSite on GitHub Pages: [handlebars-net.github.io/Handlebars.Net.Helpers](https://handlebars-net.github.io/Handlebars.Net.Helpers/)
158+
<br>Created with [Abies](https://github.com/Picea/Abies).
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Project Sdk="Microsoft.NET.Sdk.WebAssembly">
2+
<PropertyGroup>
3+
<TargetFramework>net9.0</TargetFramework>
4+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
5+
<PublishTrimmed>false</PublishTrimmed>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<Content Remove="wwwroot\abies.js" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Abies" Version="1.0.10-beta" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReference Include="..\..\src\Handlebars.Net.Helpers.DynamicLinq\Handlebars.Net.Helpers.DynamicLinq.csproj" />
18+
<ProjectReference Include="..\..\src\Handlebars.Net.Helpers.Humanizer\Handlebars.Net.Helpers.Humanizer.csproj" />
19+
<ProjectReference Include="..\..\src\Handlebars.Net.Helpers.Json\Handlebars.Net.Helpers.Json.csproj" />
20+
<ProjectReference Include="..\..\src\Handlebars.Net.Helpers.Random\Handlebars.Net.Helpers.Random.csproj" />
21+
<ProjectReference Include="..\..\src\Handlebars.Net.Helpers.Xeger\Handlebars.Net.Helpers.Xeger.csproj" />
22+
<ProjectReference Include="..\..\src\Handlebars.Net.Helpers.XPath\Handlebars.Net.Helpers.XPath.csproj" />
23+
<ProjectReference Include="..\..\src\Handlebars.Net.Helpers.Xslt\Handlebars.Net.Helpers.Xslt.csproj" />
24+
<ProjectReference Include="..\..\src\Handlebars.Net.Helpers\Handlebars.Net.Helpers.csproj" />
25+
</ItemGroup>
26+
27+
</Project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System.Runtime.CompilerServices;
2+
using Abies.DOM;
3+
using static Abies.Html.Elements;
4+
5+
namespace AbiesWebAssembly;
6+
7+
public static class Fluent
8+
{
9+
public static Element button(Attribute[] attributes, Element[] children, [CallerLineNumber] int id = 0)
10+
=> element("fluent-button", attributes, children, id);
11+
}

0 commit comments

Comments
 (0)