Skip to content

Commit

Permalink
doc site rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmelton committed Jun 20, 2021
1 parent cbb4aa7 commit f7e9b2d
Show file tree
Hide file tree
Showing 404 changed files with 1,256 additions and 22,042 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,6 +6,7 @@ release.md

# ignoring doc works for now
/docs/_site
/docs2/_site

# PowerShell Studio
*.TempPoint.*
Expand Down
37 changes: 18 additions & 19 deletions build.ps1
Expand Up @@ -49,9 +49,9 @@ if ($PSBoundParameters['PublishDocs']) {
Write-Warning "Doc processing has to run under PowerShell Core"
return
}
$docCommandPath = "$PSScriptRoot\docs\collections\_commands\"
Write-Host "Removing old command docs [$docCommandPath]" -ForegroundColor Black -BackgroundColor DarkCyan
Remove-Item $docCommandPath -Filter *.md -Recurse -Force -Confirm:$false -ErrorAction SilentlyContinue -Verbose
$docRoot = "$PSScriptRoot\docs\commands"
$functionsRoot = "$PSScriptRoot\src\functions"
$functionDirectories = [IO.Directory]::GetDirectories($functionsRoot)

Import-Module platyPS
$cmdParams = @{
Expand All @@ -60,22 +60,21 @@ if ($PSBoundParameters['PublishDocs']) {
}
$commands = Get-Command @cmdParams

Write-Host "Generating new command docs [$docCommandPath]" -ForegroundColor Black -BackgroundColor DarkCyan
foreach ($cmd in $commands) {
switch ($cmd.Name) {
{ $_ -match 'Secret' } { $category = 'secrets' }
{ $_ -match 'Report' } { $category = 'reports' }
{ $_ -match 'Group' } { $category = 'groups' }
{ $_ -match 'Folder' } { $category = 'folders' }
default { $category = 'general' }
}
$metadata = @{
'category' = $category
'title' = $cmd.Name
}

New-MarkdownHelp -OutputFolder $docCommandPath -Command $cmd.Name -Metadata $metadata -Force
}
$functionDirectories.foreach({
$categoryFolder = Split-Path $_ -Leaf
$categoryFolderName = $categoryFolder -replace '-', '_'
$docCommandPath = [IO.Path]::Combine($docRoot,$categoryFolderName)

if (Test-Path $docCommandPath) {
$helpNames = Get-ChildItem $_ -File | ForEach-Object { $_.BaseName -replace '-','-Tss' }
$helpCommands = $commands.Where({ $_.Name -in $helpNames })
$helpCommands.foreach({
New-MarkdownHelp -OutputFolder $docCommandPath -Command $_.Name -NoMetadata -Force
})
} else {
Write-Error "Doc path does not exist: $docCommandPath"
}
})
return
}

Expand Down
8 changes: 8 additions & 0 deletions docs/.debug.yml
@@ -0,0 +1,8 @@
remote_theme: false

debug:
compress: false
dist: true
shortcodes: true

theme: jekyll-rtd-theme
14 changes: 2 additions & 12 deletions docs/.gitignore
@@ -1,15 +1,5 @@
*.gem
*.sublime-project
*.sublime-workspace
.bundle
.DS_Store
.jekyll-metadata
.sass-cache
_asset_bundler_cache
_site
vendor
codekit-config.json
example/_site
.sass-cache

Gemfile.lock
node_modules
npm-debug.log*
11 changes: 0 additions & 11 deletions docs/.travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion docs/Gemfile
@@ -1,4 +1,5 @@
source "https://rubygems.org"

gem "jekyll-rtd-theme", "~> 2.0.5"

gem "github-pages", group: :jekyll_plugins
gem "jekyll-include-cache", group: :jekyll_plugins
21 changes: 0 additions & 21 deletions docs/LICENSE

This file was deleted.

16 changes: 16 additions & 0 deletions docs/Makefile
@@ -0,0 +1,16 @@
DEBUG=JEKYLL_GITHUB_TOKEN=blank PAGES_API_URL=http://0.0.0.0

default:
@gem install jekyll bundler && bundle install

update:
@bundle update

clean:
@bundle exec jekyll clean

build: clean
@${DEBUG} bundle exec jekyll build --profile --config _config.yml,.debug.yml

server: clean
@${DEBUG} bundle exec jekyll server --livereload --config _config.yml,.debug.yml
7 changes: 7 additions & 0 deletions docs/README.md
@@ -0,0 +1,7 @@
---
sort: 1
---

# Docs folder

{% include list.liquid all=true %}
76 changes: 0 additions & 76 deletions docs/Rakefile

This file was deleted.

0 comments on commit f7e9b2d

Please sign in to comment.