Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to eng/common docindex reference #17728

Closed
wants to merge 10 commits into from
Closed
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
10 changes: 5 additions & 5 deletions eng/common/docgeneration/Generate-DocIndex.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function GenerateDocfxTocContent([Hashtable]$tocContent, [String]$lang) {
New-Item -Path $YmlPath -Name "toc.yml" -Force
$visitedService = @{}
# Sort and display toc service name by alphabetical order, and then sort artifact by order.
foreach ($serviceMapping in ($tocContent.GetEnumerator() | Sort-Object Value[0], Key)) {
foreach ($serviceMapping in ($tocContent.GetEnumerator() | Sort-Object Value, Key)) {
$artifact = $serviceMapping.Key
$serviceName = $serviceMapping.Value[0]
$displayName = $serviceMapping.Value[1]
Expand Down Expand Up @@ -162,18 +162,18 @@ function GenerateDocfxTocContent([Hashtable]$tocContent, [String]$lang) {
Copy-Item "${DocGenDir}/assets/logo.svg" -Destination "${DocOutDir}/_site/" -Force
}

function Mutate-Files {
function UpdateDocIndexFiles {
Param (
[Parameter(Mandatory=$true)] [String]$appTitle,
[Parameter(Mandatory=$true)] [String]$appTitleLang,
[Parameter(Mandatory=$true)] [String]$lang,
[Parameter(Mandatory=$true)] [String]$indexhtmlloc,
[Parameter(Mandatory=$false)] [String]$packageRegex = "`"`"",
[Parameter(Mandatory=$false)] [String]$regexReplacement = ""
)
# Update docfx.json
$docfxContent = Get-Content -Path $DocfxJsonPath -Raw
$docfxContent = $docfxContent -replace "`"_appTitle`": `"`"", "`"_appTitle`": `"$appTitle`""
$docfxContent = $docfxContent -replace "`"_appFooter`": `"`"", "`"_appFooter`": `"$appTitle`""
$docfxContent = $docfxContent -replace "`"_appTitle`": `"`"", "`"_appTitle`": `"Azure SDK for $appTitleLang`""
$docfxContent = $docfxContent -replace "`"_appFooter`": `"`"", "`"_appFooter`": `"Azure SDK for $appTitleLang`""
Set-Content -Path $DocfxJsonPath -Value $docfxContent
# Update main.js var lang
$mainJsContent = Get-Content -Path $MainJsPath -Raw
Expand Down
4 changes: 1 addition & 3 deletions eng/common/pipelines/templates/steps/docindex.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
jobs:
- job: CreateDocIndex
variables:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you plan to make this in the tools repo once you get this working here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this is a miss when I do testing. Since the docindex is not in master, I haven't done full testing on pipeline. Will test all repo and submit another change in tool repo.

- template: templates/variables/globals.yml
pool:
vmImage: windows-2019
steps:
Expand Down Expand Up @@ -49,7 +47,7 @@ jobs:
targetPath: $(Build.ArtifactStagingDirectory)/docfx_project/_site

- pwsh: |
git checkout -b gh-pages-local --track origin/gh-pages-root
git checkout -b gh-pages-local --track origin/gh-pages-root -f
workingDirectory: $(Build.SourcesDirectory)
displayName: Git pull GH pages branch

Expand Down
4 changes: 4 additions & 0 deletions eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ $PackageRepository = "Maven"
$packagePattern = "*.pom"
$MetadataUri = "https://raw.githubusercontent.com/Azure/azure-sdk/master/_data/releases/latest/java-packages.csv"
$BlobStorageUrl = "https://azuresdkdocs.blob.core.windows.net/%24web?restype=container&comp=list&prefix=java%2F&delimiter=%2F"
$IndexHtmlLoc = "index.html"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any case where this isn't index.html, and if there is can we change it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally, .NET points to api/index.html.

https://azuresdkdocs.blob.core.windows.net/$web/dotnet/Azure.AI.TextAnalytics/1.0.0/api/index.html

I can do double check if it can be replaced by index.html

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to have them all be index.hml if possible. This is one of those other inconsistencies that has bothered me and we have to workaround. See https://github.com/Azure/azure-sdk/blob/master/eng/scripts/Update-Release-Versions.ps1#L59 as an example were we had do workaround these being different.

$AppTitleLang = "Java"

function Get-java-PackageInfoFromRepo ($pkgPath, $serviceDirectory, $pkgName)
{
Expand Down Expand Up @@ -157,6 +159,8 @@ function Publish-java-GithubIODocs ($DocLocation, $PublicArtifactLocation)
}

function Get-java-GithubIoDocIndex() {
# Fill in language specific information using script.
UpdateDocIndexFiles -appTitleLang $AppTitleLang -lang $Language -indexhtmlloc $IndexHtmlLoc
# Fetch out all package metadata from csv file.
$metadata = Get-CSVMetadata -MetadataUri $MetadataUri
# Leave the track 2 packages if multiple packages fetched out.
Expand Down