Skip to content

Commit 494a008

Browse files
committed
docs(docfx): Update filterconfig excludes and create scripts to automate the cleanup and docs build
1 parent 09d3ff9 commit 494a008

File tree

5 files changed

+96
-6
lines changed

5 files changed

+96
-6
lines changed

doc/Build-Docs.ps1

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env pwsh
2+
<#
3+
.SYNOPSIS
4+
Builds DocFX documentation with clean API regeneration.
5+
6+
.DESCRIPTION
7+
1. Cleans obsolete API documentation files
8+
2. Regenerates metadata from current source code
9+
3. Builds the documentation site
10+
11+
.EXAMPLE
12+
.\Build-Docs.ps1
13+
#>
14+
15+
[CmdletBinding()]
16+
param(
17+
[Parameter()]
18+
[ValidateSet('Quiet', 'Info', 'Warning', 'Error', 'Verbose')]
19+
[string]$LogLevel = 'Warning'
20+
)
21+
22+
Set-Location $PSScriptRoot
23+
24+
# Step 1: Clean obsolete API docs
25+
Write-Host "`n==> Cleaning obsolete API documentation..." -ForegroundColor Cyan
26+
& .\Clean-ApiDocs.ps1
27+
28+
# Step 2: Run DocFX (metadata + build + pdf in one command)
29+
Write-Host "`n==> Running DocFX (metadata, build, pdf)..." -ForegroundColor Cyan
30+
docfx docfx.json --logLevel $LogLevel
31+
if ($LASTEXITCODE -ne 0) {
32+
Write-Error "DocFX build failed"
33+
exit $LASTEXITCODE
34+
}
35+
36+
Write-Host "`n✓ Documentation built successfully!" -ForegroundColor Green
37+
Write-Host "Output: $PSScriptRoot\_site" -ForegroundColor Gray

doc/Clean-ApiDocs.ps1

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env pwsh
2+
<#
3+
.SYNOPSIS
4+
Cleans obsolete API documentation files before regenerating with DocFX.
5+
6+
.DESCRIPTION
7+
Removes all generated YAML files from the api/ directory and the _site/
8+
output folder to ensure only current types are documented and built.
9+
Preserves any manually-created markdown files like api/index.md.
10+
11+
.EXAMPLE
12+
.\Clean-ApiDocs.ps1
13+
#>
14+
15+
[CmdletBinding()]
16+
param()
17+
18+
$apiPath = Join-Path $PSScriptRoot "api"
19+
$sitePath = Join-Path $PSScriptRoot "_site"
20+
21+
# Clean API folder
22+
if (Test-Path $apiPath) {
23+
Write-Host "Cleaning API documentation folder: $apiPath" -ForegroundColor Cyan
24+
25+
# Remove all .yml files (generated API docs)
26+
Get-ChildItem -Path $apiPath -Filter "*.yml" -File | Remove-Item -Force -Verbose
27+
28+
Write-Host "✓ Cleaned obsolete API documentation files" -ForegroundColor Green
29+
} else {
30+
Write-Host "API folder does not exist yet: $apiPath" -ForegroundColor Yellow
31+
}
32+
33+
# Clean _site folder
34+
if (Test-Path $sitePath) {
35+
Write-Host "Cleaning output site folder: $sitePath" -ForegroundColor Cyan
36+
Remove-Item -Path $sitePath -Recurse -Force -Verbose
37+
Write-Host "✓ Cleaned output site folder" -ForegroundColor Green
38+
} else {
39+
Write-Host "Output site folder does not exist yet: $sitePath" -ForegroundColor Yellow
40+
}

doc/Resources/filterConfig.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,23 @@
22
apiRules:
33
- exclude:
44
uidRegex: ^Uno\.Resizetizer$
5-
type: namespace
5+
type: Namespace
66
- exclude:
77
uidRegex: ^DevTKSS\.Uno\.Samples\.MvuxGallery\.ReactiveViewModelMappings$
8-
type: namespace
8+
type: Type
99
- exclude:
10-
uidRegex: ^__Reactive$
11-
type: method
10+
uidRegex: ^DevTKSS\.Uno\.Samples\.MvuxGallery\.GlobalStaticResources$
11+
type: Type
12+
# Exclude all auto-generated ViewModel types (end with ViewModel suffix)
13+
- exclude:
14+
uidRegex: ViewModel$
15+
type: Type
16+
# Exclude all types with BindableAttribute (catches generated Bindable*ViewModel types)
17+
- exclude:
18+
hasAttribute:
19+
uid: Uno.Extensions.Reactive.BindableAttribute
20+
type: Type
21+
# Exclude __Reactive methods
22+
- exclude:
23+
uidRegex: __Reactive(\(.*\))?$
24+
type: Member

doc/docfx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
{
6868
"files":[
6969
"api/**.md",
70-
"api/**.yml",
70+
// "api/**.yml",
7171
"articles/**.md",
7272
"articles/**.yml",
7373
"index.md"

src/global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"msbuild-sdks": {
3-
"Uno.Sdk": "6.2.29"
3+
"Uno.Sdk": "6.3.28"
44
},
55
"sdk": {
66
"allowPrerelease": false

0 commit comments

Comments
 (0)