Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
publicarray committed Jan 17, 2026
commit 48e8395f4bf8b616442e11fd0c29676e28b33ab7
37 changes: 2 additions & 35 deletions docs/file-scrapers.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,47 +329,14 @@ curl -o PowerShell-Docs-main.zip 'https://github.com/MicrosoftDocs/PowerShell-Do
unzip PowerShell-Docs-main.zip
cd PowerShell-Docs-main

## Has missing documentation, claims it can't find files from toc.yml (get-help.md etc.)
# pacman -S dotnet-host aspnet-runtime
# yay -S dotnet-runtime-8.0-bin # for DocFxTocGenerator
# dotnet --list-runtimes
# dotnet tool update -g docfx
# dotnet tool install DocFxTocGenerator -g
# cd PowerShell-Docs-main/reference
# DocFxTocGenerator -d reference -sr --indexing NoDefault
# docfx reference/docfx.json -o ../docs/powershell


# strip all front matter in all Markdown files
find reference -name "*.md" -type f -exec sed -i '/^---$/,/^---$/d' {} +
## create a simpified template
# cat > reference/template.html << 'EOF'
# <!doctype html>
# <html>
# <head>
# <meta name="viewport" content="width=device-width, initial-scale=1.0" />
# <meta charset="utf-8" />
# </head>

# <body>
# <nav id="menu">
# <!--NAV-->
# </nav>
# <div id="layout">
# <article id="main" class="content">
# <!--CONTENT-->
# </article>
# </div>
# </body>
# </html>
# EOF


npx markdown-folder-to-html reference
cp -r _reference ../docs/powershell
cd ..

# process whent on indefinatly
bundle exec thor docs:generate powershell --debug
bundle exec thor docs:generate powershell

rm -rdf PowerShell-Docs-main/
rm PowerShell-Docs-main.zip
Expand Down
2 changes: 0 additions & 2 deletions lib/docs/filters/powershell/clean_html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ def call
css('.layout-body-aside').remove
css('#site-user-feedback-footer').remove
css('footer').remove
# docfx
css('.sideaffix').remove
# markdown-folder-to-html
css('#menuLink').remove
css('#menu').remove
Expand Down
10 changes: 0 additions & 10 deletions lib/docs/scrapers/powershell.rb
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
module Docs
class Powershell < FileScraper
# class Powershell < UrlScraper
self.name = 'PowerShell'
self.type = 'simple'
self.release = '7.5'
self.base_url = 'https://learn.microsoft.com/en-us/powershell'
# self.root_path = 'scripting/overview.html'
self.root_path = 'docs-conceptual/overview.html'
self.initial_paths = [
# 'scripting/toc.html',
'module/index.html',
# 'module/Microsoft.WSMan.Management/About/about_WS-Management_Cmdlets.html',
# 'module/PSWorkflow/About/about_ActivityCommonParameters.html',
# 'module/Microsoft.PowerShell.Core/About/About.html',
# 'module/PSReadLine/About/about_PSReadLine.html',
# 'module/Microsoft.PowerShell.Security/About/about_Certificate_Provider.html',
# 'module/PSScheduledJob/About/about_Scheduled_Jobs.html'
]
self.links = {
home: 'https://learn.microsoft.com/powershell',
code: 'https://github.com/MicrosoftDocs/PowerShell-Docs'
}
html_filters.push 'powershell/clean_html', 'powershell/entries'

# options[:rate_limit] = 100 # micososft docs online are ratelimited
options[:skip_patterns] = [/\/\//] # otherwise infinately adding the same pages
options[:attribution] = <<-HTML
The MIT License (MIT) Copyright (c) Microsoft Corporation
Expand Down