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

Checkin Doc Index to Master #8791

Merged
merged 1 commit into from
Dec 6, 2019
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
72 changes: 72 additions & 0 deletions eng/docgeneration/docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"metadata": [
{
"src": [
{
"files": [
"src/**.csproj"
]
}
],
"dest": "api",
"disableGitFeatures": false,
"disableDefaultFilter": false
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/**.md",
"api/index.md"
]
},
{
"files": [
"toc.yml",
"*.md"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"dest": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
"default",
"templates/matthews"
],
"postProcessors": [],
"markdownEngineName": "markdig",
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": false,
"globalMetadata": {
"_appTitle": "Azure SDK for NET",
"_appFooter": "Azure SDK for Net",
"_enableSearch": false,
"_enableNewTab": true,
"_appFaviconPath": "https://c.s-microsoft.com/favicon.ico?v2",
"_disableContribution": true
}
}
}
125 changes: 125 additions & 0 deletions eng/docgeneration/docindex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
resources:
repositories:
- repository: azure-sdk-tools
type: github
name: azure/azure-sdk-tools
endpoint: azure

jobs:
- job: GenerateDocIndex
variables:
- template: ../pipelines/templates/variables/globals.yml
pool:
vmImage: windows-2019
steps:
- pwsh: |
Invoke-WebRequest -Uri "https://github.com/dotnet/docfx/releases/download/v2.43.2/docfx.zip" `
-OutFile "docfx.zip" | Wait-Process; Expand-Archive -Path "docfx.zip" -DestinationPath "./docfx/"
workingDirectory: $(Build.BinariesDirectory)
displayName: Download and Extract DocFX
- task: CmdLine@2
displayName: Provision DocFX Directory
inputs:
script: $(Build.BinariesDirectory)/docfx/docfx.exe init -q
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: true
- pwsh: New-Item -Path . -Name "templates" -ItemType "directory"
displayName: Create Template Directory
workingDirectory: $(Build.SourcesDirectory)/docfx_project/
- task: CopyFiles@2
displayName: Copy Template to templates folder
inputs:
sourceFolder: $(Build.SourcesDirectory)/eng/docgeneration/templates
content: '**\*'
targetFolder: $(Build.SourcesDirectory)/docfx_project/templates
overWrite: true
- pwsh: ls
workingDirectory: $(Build.SourcesDirectory)/docfx_project/
- pwsh: ls
workingDirectory: $(Build.SourcesDirectory)/docfx_project/templates
- pwsh: |
Copy-Item "$(Build.SourcesDirectory)/eng/docgeneration/docfx.json" -Destination "$(Build.SourcesDirectory)/docfx_project/" -Force
displayName: Copy over docfx.json
- pwsh: |
$ServiceList = Get-ChildItem "$(Build.SourcesDirectory)/sdk" -Directory -Exclude eng, mgmtcommon, template | Sort-Object
$YmlPath = "$(Build.SourcesDirectory)/docfx_project/api"
New-Item -Path $YmlPath -Name "toc.yml" -Force
foreach ($Dir in $ServiceList)
{
New-Item -Path $YmlPath -Name "$($Dir.Name).md" -Force
Write-Host "Write to Toc.yml"
Add-Content -Path "$($YmlPath)/toc.yml" -Value "- name: $($Dir.Name.ToUpper())`r`n href: $($Dir.Name).md"
Write-Host "Write Client Header"
$PkgList = Get-ChildItem $Dir.FullName -Directory -Exclude .vs, .vscode, Azure.Security.KeyVault.Shared | Where-Object -FilterScript {$_.Name -notmatch ".Management."}
if (($PkgList | Measure-Object).count -eq 0)
{
continue
}
Add-Content -Path "$($YmlPath)/$($Dir.Name).md" -Value "# CLIENT"
Add-Content -Path "$($YmlPath)/$($Dir.Name).md" -Value "---"
foreach ($Pkg in $PkgList)
{
if (Test-Path "$($pkg.FullName)\src")
{
$ProjectName = Get-ChildItem "$($pkg.FullName)\src\*" -Include *.csproj
Write-Host "Write $($ProjectName.Name)"
Add-Content -Path "$($YmlPath)/$($Dir.Name).md" -Value "#### $($ProjectName.BaseName)"
}
}
}
foreach ($Dir in $ServiceList)
{
Write-Host "Write Mgmt Header"
$PkgList = Get-ChildItem $Dir.FullName -Directory | Where-Object -FilterScript {$_.Name -match ".Management."}
if (($PkgList | Measure-Object).count -eq 0)
{
continue
}
Add-Content -Path "$($YmlPath)/$($Dir.Name).md" -Value "# MANAGEMENT"
Add-Content -Path "$($YmlPath)/$($Dir.Name).md" -Value "---"
foreach ($Pkg in $PkgList)
{
if (Test-Path "$($pkg.FullName)\src")
{
$ProjectName = Get-ChildItem "$($pkg.FullName)\src\*" -Include *.csproj
Write-Host "Write $($ProjectName.Name)"
Add-Content -Path "$($YmlPath)/$($Dir.Name).md" -Value "#### $($ProjectName.BaseName)"
}
}
}
New-Item -Path "$(Build.SourcesDirectory)/docfx_project" -Name "toc.yml" -Force
Add-Content -Path "$(Build.SourcesDirectory)/docfx_project/toc.yml" -Value "- name: Azure SDK for NET APIs`r`n href: api/`r`n homepage: api/index.md"
Copy-Item "$(Build.SourcesDirectory)/README.md" -Destination "$(Build.SourcesDirectory)/docfx_project/api/index.md" -Force
Copy-Item "$(Build.SourcesDirectory)/*.md" -Destination "$(Build.SourcesDirectory)/docfx_project/api" -Force
displayName: Create main index and navigation toc.yml, copy over readme.
- pwsh: ls
workingDirectory: $(Build.SourcesDirectory)/docfx_project/api
- task: CmdLine@2
displayName: Build Doc Content
inputs:
script: $(Build.BinariesDirectory)/docfx/docfx.exe build
workingDirectory: $(Build.SourcesDirectory)/docfx_project/
failOnStderr: true
- pwsh: |
Copy-Item "$(Build.SourcesDirectory)/eng/docgeneration/assets/logo.svg" -Destination "$(Build.SourcesDirectory)/docfx_project/_site/" -Force
Copy-Item "$(Build.SourcesDirectory)/eng/docgeneration/assets/toc.yml" -Destination "$(Build.SourcesDirectory)/docfx_project/_site/" -Force
displayName: Replace site assets
- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
inputs:
versionSpec: '3.6'
- template: eng/pipelines/templates/scripts/mashup-doc-index.yml@azure-sdk-tools
parameters:
SourceDirectory: $(Build.SourcesDirectory)
- task: CopyFiles@2
displayName: Copy HTML to Artifacts Directory
inputs:
sourceFolder: $(Build.SourcesDirectory)/docfx_project/
content: '**\*'
targetFolder: $(Build.ArtifactStagingDirectory)/docfx_project
overWrite: true
- task: PublishPipelineArtifact@0
condition: succeeded()
inputs:
artifactName: "Doc.Index"
targetPath: $(Build.ArtifactStagingDirectory)/docfx_project/_site