Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions .github/scripts/UpdateNativeApiDocs.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#
# UpdateNativeApiDocs.ps1 is a PowerShell script designed to download the
# API docs from the specified RNW CI build in ADO and integrate them into
# our docs folder, properly tagged with New/Old architecture tags
Expand Down Expand Up @@ -48,7 +47,7 @@ Function Create-WinRtApiDocWithBadge([string]$SourceDocPath, [string]$DestDocPat
$Content = $Content.Trim()

# Write final file
$Content | Out-File -Encoding utf8NoBOM $DestDocPath
$Content | Out-File -Encoding utf8 $DestDocPath
}

Function Get-DocKind([string]$DocPath) {
Expand Down Expand Up @@ -130,7 +129,7 @@ Function Merge-WinRtApiDocs([string]$OldArchDocsPath, [string]$NewArchDocsPath,
$OldContent = $OldContent -replace "---(.*\r\n){1,}---\r\n\r\n", "`r`n`r`n# Old Architecture`r`n`r`n"
$OldContent = $OldContent -replace "\r\n#", "`r`n##"

($NewContent + $OldContent) | Out-File -Encoding utf8NoBOM -NoNewline $MergedFilePath
($NewContent + $OldContent) | Out-File -Encoding utf8 -NoNewline $MergedFilePath
Create-WinRtApiDocWithBadge -SourceDocPath $MergedFilePath -DestDocPath (Join-Path $OutputDocsPath $_) -BadgeMd $NewAndOldArchBadgeMd
}
$Kind = Get-DocKind -DocPath (Join-Path $OutputDocsPath $_)
Expand All @@ -140,12 +139,16 @@ Function Merge-WinRtApiDocs([string]$OldArchDocsPath, [string]$NewArchDocsPath,

# Clean up links to enum type values (workaround for https://github.com/asklar/winmd2md/issues/10)
(Get-ChildItem -Path $OutputDocsPath -File -Filter *-api-windows.md) | ForEach-Object {
$FilePath = $_
$FileContent = (Get-Content $FilePath -Raw)
$AllTypesByKind['enum'] | ForEach-Object {
$FileContent = $FileContent -replace "\($_#\w+\)", "($_)"
$FilePath = $_.FullName
if (Test-Path $FilePath) {
$FileContent = Get-Content $FilePath -Raw
if ($AllTypesByKind.ContainsKey('enum')) {
$AllTypesByKind['enum'] | ForEach-Object {
$FileContent = $FileContent -replace "\($_#\w+\)", "($_)"
}
}
$FileContent | Out-File -Encoding utf8 $FilePath
}
$FileContent | Out-File -Encoding utf8NoBOM -NoNewLine $FilePath
}

# Recreate index (workaround for https://github.com/asklar/winmd2md/issues/10)
Expand All @@ -159,7 +162,9 @@ Function Merge-WinRtApiDocs([string]$OldArchDocsPath, [string]$NewArchDocsPath,
$IndexContent += "`r`n"

$AllTypesByKind.Keys | Where-Object { $_ -ne 'unknown' } | Sort-Object | ForEach-Object {
$IndexContent += "## $($_.Substring(0,1).ToUpper())$($_.Substring(1))$($_.EndsWith("s") ? "es" : "s")`r`n"
$KindLabel = "$($_.Substring(0,1).ToUpper())$($_.Substring(1))"
if ($_.EndsWith("s")) { $KindLabel += "es" } else { $KindLabel += "s" }
$IndexContent += "## $KindLabel`r`n"
$AllTypesByKind[$_] | Sort-Object | ForEach-Object {
$IndexContent += "- [$_]($_)`r`n"
}
Expand All @@ -171,7 +176,7 @@ Function Merge-WinRtApiDocs([string]$OldArchDocsPath, [string]$NewArchDocsPath,
$IndexPath = (Join-Path $OutputDocsPath "index-api-windows.md")

Write-Host "Creating `"$IndexPath`""
$IndexContent | Out-File -Encoding utf8NoBOM $IndexPath
$IndexContent | Out-File -Encoding utf8 $IndexPath

# Update sidebar
$SidebarsFile = Join-Path $RepoRoot "website/sidebars.json"
Expand All @@ -181,9 +186,11 @@ Function Merge-WinRtApiDocs([string]$OldArchDocsPath, [string]$NewArchDocsPath,
$NativeApiEntries += "native-api/Native-API-Reference"

$AllTypesByKind.Keys | Where-Object { $_ -ne 'unknown' } | Sort-Object | ForEach-Object {
$KindLabel = "$($_.Substring(0,1).ToUpper())$($_.Substring(1))"
if ($_.EndsWith("s")) { $KindLabel += "es" } else { $KindLabel += "s" }
$KindObject = @{}
$KindObject['type'] = 'subcategory'
$KindObject['label'] = "$($_.Substring(0,1).ToUpper())$($_.Substring(1))$($_.EndsWith("s") ? "es" : "s")"
$KindObject['label'] = $KindLabel
$KindObject['ids'] = @()
$AllTypesByKind[$_] | Sort-Object | ForEach-Object {
$KindObject['ids'] += "native-api/$_"
Expand Down Expand Up @@ -228,4 +235,4 @@ finally
Set-Location -Path $StartingLocation
}

exit 0
exit 0
3 changes: 2 additions & 1 deletion docs/native-api/AccessibilityAction-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: AccessibilityAction
title: AccessibilityAction
---
Expand All @@ -16,3 +16,4 @@ Type: `string`

## Referenced by
- [`AccessibilityActionEventHandler`](AccessibilityActionEventHandler)

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: AccessibilityActionEventHandler
title: AccessibilityActionEventHandler
---
Expand All @@ -12,3 +12,4 @@ void **`Invoke`**([`AccessibilityAction`](AccessibilityAction) action)

## Referenced by
- [`DynamicAutomationProperties`](DynamicAutomationProperties)

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: AccessibilityInvokeEventHandler
title: AccessibilityInvokeEventHandler
---
Expand All @@ -12,3 +12,4 @@ void **`Invoke`**()

## Referenced by
- [`DynamicAutomationProperties`](DynamicAutomationProperties)

3 changes: 2 additions & 1 deletion docs/native-api/AccessibilityRoles-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: AccessibilityRoles
title: AccessibilityRoles
---
Expand Down Expand Up @@ -44,3 +44,4 @@ Kind: `enum`

## Referenced by
- [`DynamicAutomationProperties`](DynamicAutomationProperties)

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: AccessibilityStateCheckedValue
title: AccessibilityStateCheckedValue
---
Expand All @@ -15,3 +15,4 @@ Kind: `enum`

## Referenced by
- [`DynamicAutomationProperties`](DynamicAutomationProperties)

3 changes: 2 additions & 1 deletion docs/native-api/AccessibilityStates-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: AccessibilityStates
title: AccessibilityStates
---
Expand All @@ -15,3 +15,4 @@ Kind: `enum`
|`Busy` | 0x3 | |
|`Expanded` | 0x4 | |
|`CountStates` | 0x5 | |

3 changes: 2 additions & 1 deletion docs/native-api/AccessibilityValue-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: AccessibilityValue
title: AccessibilityValue
---
Expand All @@ -13,3 +13,4 @@ Kind: `enum`
|`Max` | 0x1 | |
|`Now` | 0x2 | |
|`Text` | 0x3 | |

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: ActivityIndicatorComponentView
title: ActivityIndicatorComponentView
---
Expand All @@ -10,3 +10,4 @@ Kind: `class`
Extends: [`ViewComponentView`](ViewComponentView)

> **EXPERIMENTAL**

3 changes: 2 additions & 1 deletion docs/native-api/AnimationClass-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: AnimationClass
title: AnimationClass
---
Expand All @@ -17,3 +17,4 @@ Kind: `enum`

## Referenced by
- [`IVisual`](IVisual)

3 changes: 2 additions & 1 deletion docs/native-api/AriaRole-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: AriaRole
title: AriaRole
---
Expand Down Expand Up @@ -79,3 +79,4 @@ Kind: `enum`

## Referenced by
- [`DynamicAutomationProperties`](DynamicAutomationProperties)

3 changes: 2 additions & 1 deletion docs/native-api/BackNavigationHandlerKind-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: BackNavigationHandlerKind
title: BackNavigationHandlerKind
---
Expand All @@ -14,3 +14,4 @@ Kind: `enum`

## Referenced by
- [`QuirkSettings`](QuirkSettings)

3 changes: 2 additions & 1 deletion docs/native-api/BackfaceVisibility-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: BackfaceVisibility
title: BackfaceVisibility
---
Expand All @@ -15,3 +15,4 @@ Kind: `enum`

## Referenced by
- [`IVisual`](IVisual)

3 changes: 2 additions & 1 deletion docs/native-api/BorderEffect-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: BorderEffect
title: BorderEffect
---
Expand All @@ -21,3 +21,4 @@ Implements: [`IGraphicsEffect`](https://docs.microsoft.com/uwp/api/Windows.Graph

### Source
[`IGraphicsEffectSource`](https://docs.microsoft.com/uwp/api/Windows.Graphics.Effects.IGraphicsEffectSource) `Source`

3 changes: 2 additions & 1 deletion docs/native-api/CallFunc-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: CallFunc
title: CallFunc
---
Expand All @@ -14,3 +14,4 @@ void **`Invoke`**(Object runtime)

## Referenced by
- [`CallInvoker`](CallInvoker)

3 changes: 2 additions & 1 deletion docs/native-api/CallInvoker-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: CallInvoker
title: CallInvoker
---
Expand All @@ -18,3 +18,4 @@ void **`InvokeSync`**([`CallFunc`](CallFunc) func)

## Referenced by
- [`IReactContext`](IReactContext)

3 changes: 2 additions & 1 deletion docs/native-api/CanvasComposite-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: CanvasComposite
title: CanvasComposite
---
Expand All @@ -25,3 +25,4 @@ Kind: `enum`

## Referenced by
- [`CompositeStepEffect`](CompositeStepEffect)

3 changes: 2 additions & 1 deletion docs/native-api/CanvasEdgeBehavior-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: CanvasEdgeBehavior
title: CanvasEdgeBehavior
---
Expand All @@ -15,3 +15,4 @@ Kind: `enum`

## Referenced by
- [`BorderEffect`](BorderEffect)

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: CharacterReceivedRoutedEventArgs
title: CharacterReceivedRoutedEventArgs
---
Expand All @@ -24,3 +24,4 @@ Implements: [`RoutedEventArgs`](RoutedEventArgs)

## Referenced by
- [`ComponentView`](ComponentView)

3 changes: 2 additions & 1 deletion docs/native-api/Color-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: Color
title: Color
---
Expand Down Expand Up @@ -47,3 +47,4 @@ bool **`Equals`**([`Color`](Color) color)

## Referenced by
- [`ViewProps`](ViewProps)

3 changes: 2 additions & 1 deletion docs/native-api/ColorSourceEffect-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: ColorSourceEffect
title: ColorSourceEffect
---
Expand All @@ -15,3 +15,4 @@ Implements: [`IGraphicsEffect`](https://docs.microsoft.com/uwp/api/Windows.Graph

### Name
string `Name`

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: ComponentIslandComponentViewInitializer
title: ComponentIslandComponentViewInitializer
---
Expand All @@ -14,3 +14,4 @@ void **`Invoke`**([`ContentIslandComponentView`](ContentIslandComponentView) vie

## Referenced by
- [`IReactCompositionViewComponentBuilder`](IReactCompositionViewComponentBuilder)

3 changes: 2 additions & 1 deletion docs/native-api/ComponentView-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: ComponentView
title: ComponentView
---
Expand Down Expand Up @@ -43,3 +43,4 @@ void **`ReleasePointerCapture`**([`Pointer`](Pointer) pointer)
> **EXPERIMENTAL**

Type: [`EventHandler`](https://docs.microsoft.com/uwp/api/Windows.Foundation.EventHandler-1)<Object>

3 changes: 2 additions & 1 deletion docs/native-api/ComponentViewFeatures-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: ComponentViewFeatures
title: ComponentViewFeatures
---
Expand All @@ -20,3 +20,4 @@ Kind: `enum`

## Referenced by
- [`IReactCompositionViewComponentBuilder`](IReactCompositionViewComponentBuilder)

3 changes: 2 additions & 1 deletion docs/native-api/ComponentViewInitializer-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: ComponentViewInitializer
title: ComponentViewInitializer
---
Expand All @@ -16,3 +16,4 @@ void **`Invoke`**([`ComponentView`](ComponentView) view)

## Referenced by
- [`IReactViewComponentBuilder`](IReactViewComponentBuilder)

3 changes: 2 additions & 1 deletion docs/native-api/ComponentViewUpdateMask-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: ComponentViewUpdateMask
title: ComponentViewUpdateMask
---
Expand All @@ -20,3 +20,4 @@ Kind: `enum`

## Referenced by
- [`UpdateFinalizerDelegate`](UpdateFinalizerDelegate)

3 changes: 2 additions & 1 deletion docs/native-api/CompositeStepEffect-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: CompositeStepEffect
title: CompositeStepEffect
---
Expand All @@ -21,3 +21,4 @@ Implements: [`IGraphicsEffect`](https://docs.microsoft.com/uwp/api/Windows.Graph

### Source
[`IGraphicsEffectSource`](https://docs.microsoft.com/uwp/api/Windows.Graphics.Effects.IGraphicsEffectSource) `Source`

3 changes: 2 additions & 1 deletion docs/native-api/CompositionHwndHost-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: CompositionHwndHost
title: CompositionHwndHost
---
Expand Down Expand Up @@ -45,3 +45,4 @@ Move focus to this [`CompositionHwndHost`](CompositionHwndHost)
int64_t **`TranslateMessage`**(uint32_t msg, uint64_t wParam, int64_t lParam)

> **EXPERIMENTAL**

3 changes: 2 additions & 1 deletion docs/native-api/CompositionStretch-api-windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
id: CompositionStretch
title: CompositionStretch
---
Expand All @@ -16,3 +16,4 @@ Kind: `enum`

## Referenced by
- [`IDrawingSurfaceBrush`](IDrawingSurfaceBrush)

Loading