-
Notifications
You must be signed in to change notification settings - Fork 0
/
site_gen.ps1
24 lines (23 loc) · 969 Bytes
/
site_gen.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# This script generates documentation contents in all languages
$sourcePath = Get-Location
foreach ($dir in Get-ChildItem -Directory)
{
if (Test-Path $dir\mkdocs.yml) { Set-Location $dir } else { return }
Write-Host "Building help documentation contents from $($dir)"
mkdocs build
if (Test-Path $sourcePath\$dir\site\css\theme.css)
{
Write-Host "Performing CSS layout fixes..."
Set-Location $sourcePath\$dir\site\css
$css = [IO.File]::ReadAllText("$sourcePath\$dir\site\css\theme.css")
$px_regex = "max-width:\s*\d+px"
$rem_regex = "max-width:\s*\d+rem"
$rep = "max-width:100%"
$new = $css -replace $px_regex, $rep
$new = $new -replace $rem_regex, $rep
$new | Out-File -FilePath "$sourcePath\$dir\site\css\theme.css" -Force -Encoding utf8
Write-Host "CSS layout fixes performed successfully."
}
Set-Location $sourcePath
}
Write-Host "Site generation complete."