-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ShaunLawrie/docs
Add docs site
- Loading branch information
Showing
52 changed files
with
10,441 additions
and
86 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
src/packages | ||
# build output | ||
dist/ | ||
# generated types | ||
.astro/ | ||
|
||
# dependencies | ||
node_modules/ | ||
|
||
# logs | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
|
||
# environment variables | ||
.env | ||
.env.production | ||
|
||
# macOS-specific files | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"recommendations": ["astro-build.astro-vscode"], | ||
"unwantedRecommendations": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"command": "./node_modules/.bin/astro dev", | ||
"cwd": "${workspaceFolder}/PwshSpectreConsole.Docs", | ||
"name": "Docs Development server", | ||
"request": "launch", | ||
"type": "node-terminal" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#requires -Modules HelpOut | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
Import-Module "..\PwshSpectreConsole\PwshSpectreConsole.psd1" -Force | ||
Remove-Item -Recurse -Path ".\src\content\docs\reference\*" -Force | ||
Get-Module PwshSpectreConsole | Save-MarkdownHelp -OutputPath ".\src\content\docs\reference\" -IncludeYamlHeader -YamlHeaderInformationType Metadata -ExcludeFile "*.gif", "*.png" | ||
|
||
# Post-processing for astro stuff | ||
$groups = @( | ||
@{ Name = "Prompts"; Matches = @("read-") } | ||
@{ Name = "Formatting"; Matches = @("format-") } | ||
@{ Name = "Progress"; Matches = @("invoke-", "job") } | ||
@{ Name = "Images"; Matches = @("image") } | ||
@{ Name = "Writing"; Matches = @("write-", "escaped") } | ||
@{ Name = "Config"; Matches = @("set-") } | ||
) | ||
$remove = @("Start-SpectreDemo.md") | ||
$docs = Get-ChildItem ".\src\content\docs\reference\" -Filter "*.md" -Recurse | ||
foreach($doc in $docs) { | ||
if($remove -contains $doc.Name) { | ||
Remove-Item $doc.FullName | ||
continue | ||
} | ||
|
||
$group = $null | ||
foreach($testGroup in $groups) { | ||
foreach($match in $testGroup.Matches) { | ||
if($doc.Name -like "*$match*") { | ||
$group = $testGroup | ||
break | ||
} | ||
} | ||
} | ||
|
||
$outLocation = ".\src\content\docs\reference\$($group.Name)\$($doc.Name)" | ||
if($null -eq $group) { | ||
$outLocation = $doc.FullName | ||
} | ||
New-Item -ItemType Directory -Path ".\src\content\docs\reference\$($group.Name)" -Force | Out-Null | ||
$content = Get-Content $doc.FullName -Raw | ||
Remove-Item $doc.FullName | ||
$content -replace '```PowerShell', '```powershell' -replace '(?m)^.+\n^[\-]{10,99}', '' | Out-File $outLocation | ||
} | ||
|
||
# Build the docs site | ||
npm run build --prefix .\ | ||
|
||
# Yeet it to cloudflare | ||
$choice = Read-Host "`nDeploy to CF pages? (y/n)" | ||
if($choice -eq "y") { | ||
if(npx wrangler whoami | Where-Object { $_ -like "*You are logged in*" }) { | ||
Write-Host "Already logged into cloudflare" | ||
} else { | ||
npx wrangler login | ||
} | ||
npx wrangler pages deploy .\dist --project-name pwshspectreconsole --commit-dirty=true --branch=main | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { defineConfig } from "astro/config"; | ||
import starlight from "@astrojs/starlight"; | ||
|
||
import tailwind from "@astrojs/tailwind"; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [ | ||
starlight({ | ||
title: "PwshSpectreConsole", | ||
editLink: { | ||
baseUrl: "https://github.com/ShaunLawrie/PwshSpectreConsole/edit/main/PwshSpectreConsole.Docs/", | ||
}, | ||
favicon: "/favicon.png", | ||
customCss: ["./src/tailwind.css"], | ||
social: { | ||
github: "https://github.com/ShaunLawrie/PwshSpectreConsole", | ||
twitter: "https://twitter.com/Shaun_Lawrie", | ||
}, | ||
sidebar: [ | ||
{ | ||
label: "Guides", | ||
items: [ | ||
{ | ||
label: "Install", | ||
link: "/guides/install/", | ||
}, | ||
{ | ||
label: "Getting Started", | ||
link: "/guides/get-started/", | ||
}, | ||
{ | ||
label: "FAQs", | ||
link: "/guides/faqs/", | ||
}, | ||
], | ||
}, | ||
{ | ||
label: "Command Reference", | ||
autogenerate: { | ||
directory: "reference", | ||
collapsed: true, | ||
}, | ||
}, | ||
], | ||
}), | ||
tailwind({ | ||
applyBaseStyles: false, | ||
}), | ||
], | ||
}); |
Oops, something went wrong.