posh-to-dash.py
scrapes the newly announced https://docs.microsoft.com/en-us/powershell/module/
website in order to create an offline dash-compatible archive to be viewed in Dash
, Zeal
or Velocity
:
- v0.1 -- Minimal working version
- v0.2 -- Offline mode supported
- v0.3 -- travis setup
- v0.4 -- user contributed docset
- v0.5 -- versionned docsets
- v0.6 -- windows 10 modules documentation
- v0.7.2 -- powershell 7.1 documentation
posh-to-dash.py
relies on :
requests
for http(s) downloadsselenium
andphantomjs
for webscrapingbs4
for html parsing and rewriting
- Copy the repository
- Install the dependencies from requirements.txt, use a virtualenv to avoid problems with dependencies and versions.
- Download the geckodriver from Mozilla's Repo, download the version that matches your OS.
- Place the geckodriver in your path
-
If Windows, grab the executable an place it in
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
-
If Linux, move it to your
~/.local/bin
or wherever you have your path
- Start scraping by typing :
posh-to-dash.py --output=$outputfile --version=6 --temporary
- if
--output
is not provided,posh-to-dash.py
will output "Powershell.tgz' into the working directory - the
--version
switch support only Powershell API versions7.0
,7.1
(default) and7.2
, the rest are obsolete by Microsoft. --temporary
specify to download the web scraping resources in a temporary folder instead of clobbering the current directory. However if the download fail, the results will be thrown out.
NOTE: The process takes 15+ minutes to run. The more versions you download increases the time.
With the Powershell.tar file, unzip it and place it in C:\Users\<your-username>\AppData\Local\Zeal\Zeal\docsets
The powershell modules API endpoint is quite new, so it may be subject to breakage by the docs.microsoft.com
people.