Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evotecit/psparsehtml
PSParseHTML is PowerShell module that's main purpose is to be a helper module for PSWriteHTML. However it's functionality can be utilized in other projects, not related to PSWriteHTML, therefore it's available as a separate module.
https://github.com/evotecit/psparsehtml
css hacktoberfest html javascript powershell pswritehtml
Last synced: about 2 months ago
JSON representation
PSParseHTML is PowerShell module that's main purpose is to be a helper module for PSWriteHTML. However it's functionality can be utilized in other projects, not related to PSWriteHTML, therefore it's available as a separate module.
- Host: GitHub
- URL: https://github.com/evotecit/psparsehtml
- Owner: EvotecIT
- Created: 2019-08-10T19:45:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-19T17:56:03.000Z (10 months ago)
- Last Synced: 2024-10-29T21:06:12.308Z (about 2 months ago)
- Topics: css, hacktoberfest, html, javascript, powershell, pswritehtml
- Language: PowerShell
- Homepage:
- Size: 11.5 MB
- Stars: 73
- Watchers: 4
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.MD
- Changelog: CHANGELOG.MD
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# PSParseHTML
**PSParseHTML** started as a suite of data processing Cmdlets to help [PSWriteHTML](https://github.com/EvotecIT/PSWriteHTML), but it has gained functionality enough to be its own module. Basic usage instructions are described [on this blog post](https://evotec.xyz/formatting-and-minifying-resources-html-css-javascript-with-powershell/).
**PSParseHTML** provides the following ten (10) functions:
- Convert-HTMLToText
- ConvertFrom-HtmlTable
- ConvertFrom-HTMLAttributes (aliases: `ConvertFrom-HTMLTag`, `ConvertFrom-HTMLClass`)
- ConvertFrom-HTML
- Format-CSS
- Format-HTML
- Format-JavaScript
- Optimize-CSS
- Optimize-HTML
- Optimize-JavaScriptThe expected input is a string literal or string data read from a file. The output can be PowerShell objects (classes are `HtmlNode` or `AngleSharp.Html.Dom.HtmlElement` depending on the chosen processing engine) or string literals written to `stdout`.
It may not seem like much, but those ten functions are powerful enough to realize robust HTML processing in shell.
## Installation
### Install from PSGallery
```powershell
Install-Module -Name PSParseHTML -AllowClobber -Force
```Force and AllowClobber aren't necessary but they do skip errors in case some appear.
### Update from PSGallery
```powershell
Update-Module -Name PSParseHTML
```That's it. Whenever there's a new version you simply run the `Update-Module` command and enjoy. Remember that you may need to close, re-open your **PowerShell** session if you had used the module prior to updating it.
As usual, **remember module updates may break your scripts**: if your scripts work for you in production, retain those versions until you test new versions in a dev environment. I may make small changes which are big enough so that your automated updates will break your scripts. For example, I might make a small rename to a parameter — boom, your code stops working! Be responsible!
## 3rd party references
This module utilizes several external dependencies to do its work. The authors of those libraries have done fantastic work — I've just added some PowerShell to the mix.
- [AngleSharp](https://github.com/AngleSharp/AngleSharp) - MIT License
- [AngleSharp CSS](https://github.com/AngleSharp/AngleSharp.Css) - MIT License
- [Jsbeautifier](https://github.com/denis-ivanov/Jsbeautifier) - MIT License
- [NUglify](https://github.com/trullock/NUglify) - BSD-Clause 2 license
- [Html Agility Pack](https://github.com/zzzprojects/html-agility-pack) - MIT License