From 9302e6c3453055a07e92b828f5098f64bc3ba87b Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Mon, 28 Mar 2022 15:36:03 -0700 Subject: [PATCH] Add * in children list (#27861) --- eng/scripts/docs/Docs-ToC.ps1 | 124 +++++++++++++++++++++++++++++++++- 1 file changed, 122 insertions(+), 2 deletions(-) diff --git a/eng/scripts/docs/Docs-ToC.ps1 b/eng/scripts/docs/Docs-ToC.ps1 index 92359e2651efb..53e2dcb9cc844 100644 --- a/eng/scripts/docs/Docs-ToC.ps1 +++ b/eng/scripts/docs/Docs-ToC.ps1 @@ -104,7 +104,7 @@ function Get-Toc-Children($package, $groupId, $version, $docRepoLocation, $folde # Log and warn Write-Host "Not able to find namespaces from javadoc jar $package-$version-javadoc.jar" } - return (Get-Content $filePath | ForEach-Object {$_.Trim()}) + return (Get-Content $filePath | ForEach-Object {$_.Trim() + "*"}) } function Fetch-Namespaces-From-Javadoc ($jarFilePath, $destination) { @@ -152,5 +152,125 @@ function Parse-Overview-Frame ($filePath, $destination) { $packages = [RegEx]::Matches($htmlBody, "
  • (?.*?)<\/a><\/li>") $namespaces = $packages | ForEach-Object { $_.Groups["package"].Value } Add-Content -Path $destination -Value $namespaces - Get-Content $destination +} + +function Get-java-UpdatedDocsMsToc($toc) { + $services = $toc[0].items + # Add services exsting in old toc but missing in automation. + $otherService = $services[-1] + $sortableServices = $services | Where-Object { $_ –ne $otherService } + $sortableServices += [PSCustomObject]@{ + name = "Active Directory" + href = "~/docs-ref-services/{moniker}/resourcemanager-msi-readme.md" + landingPageType = "Service" + items = @( + [PSCustomObject]@{ + name = "Resource Management" + href = "~/docs-ref-services/{moniker}/resourcemanager-msi-readme.md" + children = @("com.azure.resourcemanager.msi*") + }, + [PSCustomObject]@{ + name = "client" + href = "~/docs-ref-services/{moniker}/resourcemanager-msi-readme.md" + children = @( + "com.microsoft.aad.adal*", + "com.microsoft.aad.adal4j*", + "com.microsoft.identity.client*") + }) + } + $sortableServices += [PSCustomObject]@{ + name = "Edge Gateway" + landingPageType = "Service" + items = @( + [PSCustomObject]@{ + name = "Resource Management" + children = @("com.microsoft.azure.management.edgegateway*") + }) + } + $sortableServices += [PSCustomObject]@{ + name = "Resource Mover" + landingPageType = "Service" + items = @( + [PSCustomObject]@{ + name = "Resource Management" + children = @("com.microsoft.azure.management.resourcemover.v2021_01_01*") + }) + } + $sortableServices += [PSCustomObject]@{ + name = "Bing AutoSuggest" + landingPageType = "Service" + items = @( + [PSCustomObject]@{ + name = "Management" + href = "~/docs-ref-services/{moniker}/cognitiveservices/bing-autosuggest-readme.md" + children = @("com.microsoft.azure.cognitiveservices.search.autosuggest*") + }) + } + $sortableServices += [PSCustomObject]@{ + name = "Content Moderator" + landingPageType = "Service" + items = @( + [PSCustomObject]@{ + name = "Management" + children = @("com.microsoft.azure.cognitiveservices.vision.contentmoderator*") + }) + } + $sortableServices += [PSCustomObject]@{ + name = "Custom Vision" + landingPageType = "Service" + items = @( + [PSCustomObject]@{ + name = "Management" + children = @("com.microsoft.azure.cognitiveservices.vision.customvision*") + }) + } + $sortableServices += [PSCustomObject]@{ + name = "Face API" + landingPageType = "Service" + items = @( + [PSCustomObject]@{ + name = "Management" + children = @("com.microsoft.azure.cognitiveservices.vision.faceapi*") + }) + } + $sortableServices += [PSCustomObject]@{ + name = "Language Understanding" + landingPageType = "Service" + items = @( + [PSCustomObject]@{ + name = "Management" + children = @( + "com.microsoft.azure.cognitiveservices.language.luis*", + "com.microsoft.azure.cognitiveservices.language.luis.authoring*") + }) + } + $sortableServices += [PSCustomObject]@{ + name = "Speech Service" + landingPageType = "Service" + items = @( + [PSCustomObject]@{ + name = "Management" + children = @("com.microsoft.cognitiveservices.speech*") + }) + } + $sortableServices += [PSCustomObject]@{ + name = "Text Analytics" + landingPageType = "Service" + items = @( + [PSCustomObject]@{ + name = "Management" + children = @("com.microsoft.azure.cognitiveservices.language.text*") + }) + } + $sortableServices += [PSCustomObject]@{ + name = "Cognitive Services" + landingPageType = "Service" + items = @( + [PSCustomObject]@{ + name = "Resource Management" + children = @("com.microsoft.azure.management.cognitiveservices*") + }) + } + $toc[0].items = ($sortableServices | Sort-Object -Property name) + $otherService + return , $toc }