PSHTML is a cross platform Powershell module to generate HTML markup language within a DSL.
PSHTML
allow people to write a HTML document(s) using powershell-like
syntax, which makes building webpages easier, and less cumbersome for 'native' powersheller's.
PSHTML
offers the flexibility of the PowerShell language, and allows to add logic in powershell
directly in the HTML
structure. This open the possibility to add loops, conditional statements, switchs, functions, classes, calling external modules etc.. all that directly from the same editor.
PSHTML
comes with a templating functionality which allows one to include
parts of webpages that are identical throughout the web page Eg: footer, Header,Menu etc..
Using PSHTML, offers code completition and syntax highliting from the the default powershell langauge. As PSHTML respects the W3C standards, any HTML errors, will be spotted immediatly.
Branch | Status |
---|---|
master | |
dev |
A change log is available here Known issues are tracked here
The following quick example displays a simple page, with a few headers, divs, paragraphs, and header elements
html {
head{
title "woop title"
link "css/normalize.css" "stylesheet"
}
body{
Header {
h1 "This is h1 Title in header"
div {
p {
"This is simply a paragraph in a div."
}
}
}
p {
h1 "This is h1"
h2 "This is h2"
h3 "This is h3"
h4 "This is h4"
h5 "This is h5"
h6 "This is h6"
strong "plop";"Woop"
}
}
}
The following example is a tribute to PowerShell GodFather 'Jeffrey Snover' where we generated a BIO of the ShellFather gathering data from Wikipedia and other sources, all that using Powershell.
The example PSHTML / Powershell
code is available here
The generated HTML
code is available here
Check out the Documentation on how to use PSHTML.
- Introducing PSHTML on PowershellDistrict.
- Multiple Blog posts from @ChendrayanV.
- Presentation at Glasgow Super Meetup by @anthonyroud.
Find here a few examples where people already used PSHTML in an awesome way.
- Blog post from @ChendrayanV Autorefresh pages with Polaris and PSHTML
- Docker Image with Polaris and PSHTML created by @StijnCa.
- Build your own API Presentation by @ravikanth at PSConfAsia. The PSHTML part starts at 31 minutes, however it is worth it to watch the whole session.
If you're interessted in contributing to PSHTML please be sure to check out the Contribution Guide.