Skip to content

Commit

Permalink
Add * in children list (Azure#27861)
Browse files Browse the repository at this point in the history
  • Loading branch information
sima-zhu authored Mar 28, 2022
1 parent 8218284 commit 9302e6c
Showing 1 changed file with 122 additions and 2 deletions.
124 changes: 122 additions & 2 deletions eng/scripts/docs/Docs-ToC.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -152,5 +152,125 @@ function Parse-Overview-Frame ($filePath, $destination) {
$packages = [RegEx]::Matches($htmlBody, "<li><a.*?>(?<package>.*?)<\/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
}

0 comments on commit 9302e6c

Please sign in to comment.