Functions/Public/p.ps1
Function p { <# .SYNOPSIS Create a p tag in an HTML document. .PARAMETER Class Allows to specify one (or more) class(es) to assign the html element. More then one class can be assigned by seperating them with a white space. .PARAMETER Id Allows to specify an id to assign the html element. .PARAMETER Style Allows to specify in line CSS style to assign the html element. .PARAMETER Content Allows to add child element(s) inside the current opening and closing HTML tag(s). .EXAMPLE p .EXAMPLE p "woop1" -Class "class" .EXAMPLE p "woop2" -Class "class" -Id "Something" .EXAMPLE p "woop3" -Class "class" -Id "something" -Style "color:red;" .EXAMPLE p { $Important = strong{"This is REALLY important"} "This is regular test in a paragraph " + $Important } Generates the following code <p> This is regular test in a paragraph <strong>"This is REALLY important"</strong> </p> .NOTES Current version 3.1.0 History: 2018.11.1; Stephanevg;Updated to version 3.1 2018.10.30;@ChristopheKumor;Updated to version 3.0 2018.04.10;Stephanevg;Updated content (removed string, added if for selection between scriptblock and string). 2018.04.01;bateskevinhanevg;Creation. .LINK https://github.com/Stephanevg/PSHTML #> [Cmdletbinding()] Param( [Parameter(Mandatory = $false)] [AllowEmptyString()] [AllowNull()] $Content, [AllowEmptyString()] [AllowNull()] [String]$Class, [String]$Id, [AllowEmptyString()] [AllowNull()] [String]$Style, [String]$title, [Hashtable]$Attributes ) $tagname = "p" Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType NonVoid } |