Добавлена документация
This commit is contained in:
22
scripts/generate-docs.ps1
Normal file
22
scripts/generate-docs.ps1
Normal file
@@ -0,0 +1,22 @@
|
||||
Param(
|
||||
[string]$DocfxPath = "docfx",
|
||||
[string]$WorkingDir = "$(Resolve-Path .)"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
Write-Host "Generating docfx documentation..."
|
||||
|
||||
if (-not (Get-Command $DocfxPath -ErrorAction SilentlyContinue)) {
|
||||
Write-Host "Docfx not found on PATH. Install docfx or provide full path to docfx.exe" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
Push-Location $WorkingDir
|
||||
try {
|
||||
& $DocfxPath metadata docfx.json
|
||||
& $DocfxPath build docfx.json
|
||||
Write-Host "Docfx build complete. Output in _site folder" -ForegroundColor Green
|
||||
}
|
||||
finally {
|
||||
Pop-Location
|
||||
}
|
||||
14
scripts/generate-docs.sh
Normal file
14
scripts/generate-docs.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
DOCFX_PATH=${DOCFX_PATH:-docfx}
|
||||
WORKING_DIR=$(pwd)
|
||||
|
||||
if ! command -v "$DOCFX_PATH" >/dev/null 2>&1; then
|
||||
echo "docfx not found. Install it or set DOCFX_PATH to the executable path."
|
||||
fi
|
||||
|
||||
pushd "$WORKING_DIR" > /dev/null
|
||||
$DOCFX_PATH metadata docfx.json
|
||||
$DOCFX_PATH build docfx.json
|
||||
popd > /dev/null
|
||||
|
||||
echo "Docfx build complete. Output in _site folder"
|
||||
Reference in New Issue
Block a user