Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,6 @@ insert_final_newline = true
tab_width = 2
trim_trailing_whitespace = true

[*.cs]
csharp_indent_case_contents_when_block = false
csharp_indent_labels = no_change
csharp_new_line_before_open_brace = none
csharp_prefer_braces = false
csharp_space_after_cast = true
csharp_space_before_colon_in_inheritance_clause = false
csharp_style_expression_bodied_constructors = true
csharp_style_expression_bodied_local_functions = true
csharp_style_expression_bodied_methods = true
csharp_style_expression_bodied_operators = true
csharp_style_namespace_declarations = file_scoped
csharp_style_var_elsewhere = true
csharp_style_var_for_built_in_types = true
csharp_style_var_when_type_is_apparent = true
csharp_using_directive_placement = inside_namespace
dotnet_diagnostic.CS8524.severity = silent
dotnet_sort_system_directives_first = false
dotnet_style_namespace_match_folder = false

[*.md]
trim_trailing_whitespace = false

Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/ContinuousIntegration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ jobs:
steps:
- name: Fetch sources
uses: actions/checkout@v6
- name: Set up .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10
- name: Set up PowerShell
run: |
Invoke-WebRequest "https://aka.ms/install-powershell.ps1" -OutFile Install-PowerShell.ps1
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/**/*.user
/.idea/
/.vs/
/bin/
/*/obj/
/src/**/*.g.cs
/src/Generated/
/var/
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"recommendations": [
"ms-dotnettools.csdevkit",
"ms-vscode.powershell"
]
}
1 change: 0 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"configurations": [
{
"name": "Script",
"preLaunchTask": "Build",
"request": "launch",
"type": "PowerShell",
"script": "${workspaceFolder}/Debug.ps1"
Expand Down
11 changes: 0 additions & 11 deletions .vscode/tasks.json

This file was deleted.

32 changes: 18 additions & 14 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,63 @@
# Changelog

## Version [1.2.0](https://github.com/cedx/html.net/compare/v1.1.0...v1.2.0)
## Version [2.0.0](https://github.com/cedx/html.ps1/compare/v1.2.0...v2.0.0)
- Breaking change: ported the source code to [PowerShell](https://learn.microsoft.com/en-us/powershell).
- Breaking change: renamed the `-DataSet` parameter to `-Data`.

## Version [1.2.0](https://github.com/cedx/html.ps1/compare/v1.1.0...v1.2.0)
- Added the `Use-Layout` and `Write-View` cmdlets.

## Version [1.1.0](https://github.com/cedx/html.net/compare/v1.0.1...v1.1.0)
## Version [1.1.0](https://github.com/cedx/html.ps1/compare/v1.0.1...v1.1.0)
- Added support for `[switch]` parameters in attribute values.
- The `New-DelElement`, `New-InsElement` and `New-TimeElement` cmdlets now use a non-terminating error.

## Version [1.0.1](https://github.com/cedx/html.net/compare/v1.0.0...v1.0.1)
## Version [1.0.1](https://github.com/cedx/html.ps1/compare/v1.0.0...v1.0.1)
- Fixed a packaging issue: the generated cmdlets were not included in the release.

## Version [1.0.0](https://github.com/cedx/html.net/compare/v0.10.0...v1.0.0)
## Version [1.0.0](https://github.com/cedx/html.ps1/compare/v0.10.0...v1.0.0)
- Added the `New-FormElement`, `New-IframeElement`, `New-InputElement`, `New-TemplateElement` and `New-TextareaElement` cmdlets.
- Added the `form`, `iframe`, `input`, `template` and `textarea` aliases.

## Version [0.10.0](https://github.com/cedx/html.net/compare/v0.9.0...v0.10.0)
## Version [0.10.0](https://github.com/cedx/html.ps1/compare/v0.9.0...v0.10.0)
- Added the `New-ButtonElement`, `New-QElement`, `New-SelectElement`, `New-SlotElement` and `New-SourceElement` cmdlets.
- Added the `button`, `q`, `selectTag`, `slot` and `source` aliases.
- The common parameter `-Style` is now an `OrderedHashtable`, allowing the declaration order to be preserved.

## Version [0.9.0](https://github.com/cedx/html.net/compare/v0.8.0...v0.9.0)
## Version [0.9.0](https://github.com/cedx/html.ps1/compare/v0.8.0...v0.9.0)
- Added the `New-OlElement`, `New-OptgroupElement`, `New-OptionElement`, `New-OutputElement` and `New-ProgressElement` cmdlets.
- Added the `ol`, `optgroup`, `option`, `output` and `progress` aliases.

## Version [0.8.0](https://github.com/cedx/html.net/compare/v0.7.0...v0.8.0)
## Version [0.8.0](https://github.com/cedx/html.ps1/compare/v0.7.0...v0.8.0)
- Added the `New-LabelElement`, `New-LiElement`, `New-MapElement`, `New-MeterElement` and `New-ObjectElement` cmdlets.
- Added the `label`, `li`, `map`, `meter` and `object` aliases.
- Renamed the common parameter `-Data` to `-DataSet`.

## Version [0.7.0](https://github.com/cedx/html.net/compare/v0.6.0...v0.7.0)
## Version [0.7.0](https://github.com/cedx/html.ps1/compare/v0.6.0...v0.7.0)
- Added the `New-DetailsElement`, `New-DialogElement`, `New-EmbedElement`, `New-FieldsetElement` and `New-InsElement` cmdlets.
- Added the `details`, `dialog`, `embed`, `fieldset` and `ins` aliases.

## Version [0.6.0](https://github.com/cedx/html.net/compare/v0.5.0...v0.6.0)
## Version [0.6.0](https://github.com/cedx/html.ps1/compare/v0.5.0...v0.6.0)
- Added the `Html` prefix to the nouns of all cmdlets.
- Added the `New-DelElement`, `New-TdElement`, `New-ThElement`, `New-TimeElement` and `New-TrackElement` cmdlets.
- Added the `delTag`, `td`, `th`, `time` and `track` aliases.

## Version [0.5.0](https://github.com/cedx/html.net/compare/v0.4.0...v0.5.0)
## Version [0.5.0](https://github.com/cedx/html.ps1/compare/v0.4.0...v0.5.0)
- Added the `New-ColGroupElement`, `New-DataElement`, `New-StyleElement` and `New-VideoElement` cmdlets.
- Added the `colgroup`, `dataTag`, `style` and `video` aliases.

## Version [0.4.0](https://github.com/cedx/html.net/compare/v0.3.0...v0.4.0)
## Version [0.4.0](https://github.com/cedx/html.ps1/compare/v0.3.0...v0.4.0)
- Added support for the `on*` and `tabindex` attributes.
- Added the `New-AudioElement`, `New-BlockquoteElement`, `New-CanvasElement` and `New-ColElement` cmdlets.
- Added the `audio`, `blockquote`, `canvas` and `col` aliases.
- Renamed the `New-Doctype` cmdlet to `New-DocumentType`.

## Version [0.3.0](https://github.com/cedx/html.net/compare/v0.2.0...v0.3.0)
## Version [0.3.0](https://github.com/cedx/html.ps1/compare/v0.2.0...v0.3.0)
- Added support for the `data-*`, `dir`, `lang` and `title` attributes.
- Added the `New-AElement`, `New-AreaElement`, `New-ImgElement` and `New-ScriptElement` cmdlets.
- Added the `a`, `area`, `img` and `script` aliases.

## Version [0.2.0](https://github.com/cedx/html.net/compare/v0.1.0...v0.2.0)
- Added the `New-BaseElement`, `New-HtmlElement`, `New-LinkElement` and `New-MetaElement` cmdlets.
## Version [0.2.0](https://github.com/cedx/html.ps1/compare/v0.1.0...v0.2.0)
- Added the `New-BaseElement`, `Write-HtmlElement`, `New-LinkElement` and `New-MetaElement` cmdlets.
- Added the `base`, `html`, `link` and `meta` aliases.

## Version 0.1.0
Expand Down
140 changes: 19 additions & 121 deletions Html.psd1
Original file line number Diff line number Diff line change
@@ -1,145 +1,43 @@
@{
ModuleVersion = "1.2.0"
# DefaultCommandPrefix = "Html"
ModuleVersion = "2.0.0"
PowerShellVersion = "7.6"
RootModule = "bin/Belin.Html.dll"

Author = "Cédric Belin <cedx@outlook.com>"
CompanyName = "Cedric-Belin.fr"
Copyright = "© Cédric Belin"
Description = "PowerShell cmdlets for rendering HTML documents."
GUID = "3c16800c-921e-4c31-9fc3-00052d2f30ba"

AliasesToExport = "doctype", "layout"
FunctionsToExport = "New-HtmlDocumentType", "Use-HtmlLayout", "Write-HtmlView"
CmdletsToExport = @()
VariablesToExport = @()

CmdletsToExport = @(
"New-HtmlAbbrElement"
"New-HtmlAddressElement"
AliasesToExport = @(
"doctype"
"a"
"area"
"tag"
)

FunctionsToExport = @(
"New-HtmlAElement"
"New-HtmlAreaElement"
"New-HtmlArticleElement"
"New-HtmlAsideElement"
"New-HtmlAudioElement"
"New-HtmlBaseElement"
"New-HtmlBdiElement"
"New-HtmlBdoElement"
"New-HtmlBElement"
"New-HtmlBlockquoteElement"
"New-HtmlBodyElement"
"New-HtmlBrElement"
"New-HtmlButtonElement"
"New-HtmlCanvasElement"
"New-HtmlCaptionElement"
"New-HtmlCiteElement"
"New-HtmlCodeElement"
"New-HtmlColElement"
"New-HtmlColgroupElement"
"New-HtmlDocumentType"
"New-HtmlCustomElement"
"New-HtmlDataElement"
"New-HtmlDatalistElement"
"New-HtmlDdElement"
"New-HtmlDelElement"
"New-HtmlDetailsElement"
"New-HtmlDfnElement"
"New-HtmlDialogElement"
"New-HtmlDivElement"
"New-HtmlDlElement"
"New-HtmlDtElement"
"New-HtmlEmbedElement"
"New-HtmlEmElement"
"New-HtmlFieldsetElement"
"New-HtmlFigcaptionElement"
"New-HtmlFigureElement"
"New-HtmlFooterElement"
"New-HtmlFormElement"
"New-HtmlH1Element"
"New-HtmlH2Element"
"New-HtmlH3Element"
"New-HtmlH4Element"
"New-HtmlH5Element"
"New-HtmlH6Element"
"New-HtmlHeadElement"
"New-HtmlHeaderElement"
"New-HtmlHgroupElement"
"New-HtmlHrElement"
"New-HtmlHtmlElement"
"New-HtmlIElement"
"New-HtmlIframeElement"
"New-HtmlImgElement"
"New-HtmlInputElement"
"New-HtmlInsElement"
"New-HtmlKbdElement"
"New-HtmlLabelElement"
"New-HtmlLegendElement"
"New-HtmlLiElement"
"New-HtmlLinkElement"
"New-HtmlMainElement"
"New-HtmlMapElement"
"New-HtmlMarkElement"
"New-HtmlMenuElement"
"New-HtmlMetaElement"
"New-HtmlMeterElement"
"New-HtmlNavElement"
"New-HtmlNoscriptElement"
"New-HtmlObjectElement"
"New-HtmlOlElement"
"New-HtmlOptgroupElement"
"New-HtmlOptionElement"
"New-HtmlOutputElement"
"New-HtmlPElement"
"New-HtmlPictureElement"
"New-HtmlPreElement"
"New-HtmlProgressElement"
"New-HtmlQElement"
"New-HtmlRpElement"
"New-HtmlRtElement"
"New-HtmlRubyElement"
"New-HtmlSampElement"
"New-HtmlScriptElement"
"New-HtmlSearchElement"
"New-HtmlSectionElement"
"New-HtmlSelectElement"
"New-HtmlSElement"
"New-HtmlSlotElement"
"New-HtmlSmallElement"
"New-HtmlSourceElement"
"New-HtmlSpanElement"
"New-HtmlStrongElement"
"New-HtmlStyleElement"
"New-HtmlSubElement"
"New-HtmlSummaryElement"
"New-HtmlSupElement"
"New-HtmlTableElement"
"New-HtmlTbodyElement"
"New-HtmlTdElement"
"New-HtmlTemplateElement"
"New-HtmlTextareaElement"
"New-HtmlTfootElement"
"New-HtmlTheadElement"
"New-HtmlThElement"
"New-HtmlTimeElement"
"New-HtmlTitleElement"
"New-HtmlTrackElement"
"New-HtmlTrElement"
"New-HtmlUElement"
"New-HtmlUlElement"
"New-HtmlVarElement"
"New-HtmlVideoElement"
"New-HtmlWbrElement"
"New-HtmlAreaElement"
)

NestedModules = @(
"src/Elements/New-AElement.psm1"
"src/Elements/New-AreaElement.psm1"
"src/New-DocumentType.psm1"
"src/Use-Layout.psm1"
"src/Write-View.psm1"
"src/New-CustomElement.psm1"
)

PrivateData = @{
PSData = @{
LicenseUri = "https://github.com/cedx/html.net/blob/main/License.md"
ProjectUri = "https://github.com/cedx/html.net"
ReleaseNotes = "https://github.com/cedx/html.net/releases"
LicenseUri = "https://github.com/cedx/html.ps1/blob/main/License.md"
ProjectUri = "https://github.com/cedx/html.ps1"
ReleaseNotes = "https://github.com/cedx/html.ps1/releases"
Tags = "html", "renderer", "template", "templating", "web"
}
}
Expand Down
3 changes: 0 additions & 3 deletions Html.slnx

This file was deleted.

12 changes: 6 additions & 6 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# HTML Renderer for PS
# HTML Renderer for PowerShell
[PowerShell](https://learn.microsoft.com/en-us/powershell) cmdlets for rendering [HTML](https://developer.mozilla.org/docs/Web/HTML) documents.

## Documentation
- [User guide](https://github.com/cedx/html.net/tree/main/docs)
- [Examples](https://github.com/cedx/html.net/tree/main/example)
- [User guide](https://github.com/cedx/html.ps1/tree/main/docs)
- [Examples](https://github.com/cedx/html.ps1/tree/main/example)

## Development
- [Git repository](https://github.com/cedx/html.net)
- [Submit an issue](https://github.com/cedx/html.net/issues)
- [Git repository](https://github.com/cedx/html.ps1)
- [Submit an issue](https://github.com/cedx/html.ps1/issues)

## License
[HTML Renderer for PS](https://github.com/cedx/html.net) is distributed under the MIT License.
[HTML Renderer for PowerShell](https://github.com/cedx/html.ps1) is distributed under the MIT License.
2 changes: 1 addition & 1 deletion docs/Installation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Installation

## Requirements
Before installing **HTML Renderer for PS**, you need to make sure you have [PowerShell](https://learn.microsoft.com/en-us/powershell) up and running.
Before installing **HTML Renderer for PowerShell**, you need to make sure you have [PowerShell](https://learn.microsoft.com/en-us/powershell) up and running.
You can verify if you're already good to go with the following command:

```shell
Expand Down
2 changes: 1 addition & 1 deletion res/Content.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
param ([hashtable] $data)

h1 $data.Title
div -class alert, alert-success "Welcome to my website!"
div -Class alert, alert-success "Welcome to my website!"
2 changes: 1 addition & 1 deletion res/Footer.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
param ([hashtable] $data)

footer -class text-center {
footer -Class text-center {
"Copyright &copy; $($data.Year) - All rights reserved."
}
14 changes: 7 additions & 7 deletions res/Header.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
param ([hashtable] $data)

header {
nav -class navbar, navbar-expand-xl {
div -class container-fluid {
button -class navbar-toggler -dataset @{ BsTarget = "#menu"; BsToggle = "offcanvas" } {
span -class navbar-toggler-icon
nav -Class navbar, navbar-expand-xl {
div -Class container-fluid {
button -Class navbar-toggler -Data @{ BsTarget = "#menu"; BsToggle = "offcanvas" } {
span -Class navbar-toggler-icon
}

div -class navbar-brand, d-flex, align-items-center {
a -href Index.html { img -alt "" -src Favicon.ico -width 30 -height 30 }
div -class ms-2 $data.AppName
div -Class navbar-brand, d-flex, align-items-center {
a -Href Index.html { img -Alt "" -Src Favicon.ico -Width 30 -Height 30 }
div -Class ms-2 $data.AppName
}
}
}
Expand Down
Loading
Loading