Skip to content

Commit

Permalink
Restructuring generate-doc code folder (#5252)
Browse files Browse the repository at this point in the history
Includes updated docs generation old pipeline, refactored and improved generate-docs code, generating docs in ci and separate pipeline for the new index generation
  • Loading branch information
KarishmaGhiya authored Oct 25, 2019
1 parent e6cf99c commit 211d751
Show file tree
Hide file tree
Showing 22 changed files with 2,278 additions and 291 deletions.
2 changes: 2 additions & 0 deletions .docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ omitted_paths:
- documentation/ServicePrincipal/*
- eng/tools/analyze-deps/**
- eng/tools/select-packages/**
- eng/tools/generate-doc/**
- eng/tools/generate-static-index/**
- "sdk/*/arm-*"
- "sdk/cognitiveservices/*"
- "sdk/identity/identity/test/manual/*"
Expand Down
278 changes: 0 additions & 278 deletions common/scripts/generate-doc.js

This file was deleted.

60 changes: 60 additions & 0 deletions eng/pipelines/doc-index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
jobs:
- job: "Build"
variables:
- template: 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
- pwsh: |
$(Build.BinariesDirectory)/docfx/docfx.exe init -q
displayName: Provision DocFX Directory
workingDirectory: $(Build.SourcesDirectory)
- pwsh: |
mkdir "templates"
displayName: Create Template Directory
workingDirectory: $(Build.SourcesDirectory)/docfx_project/
- pwsh: |
Copy-Item "$(Build.SourcesDirectory)/eng/tools/generate-static-index/static-files/docfx.json" -Destination "$(Build.SourcesDirectory)/docfx_project/" -Force
displayName: Copy over docfx.json
- script: |
npm install
workingDirectory: $(System.DefaultWorkingDirectory)/eng/tools/generate-static-index
displayName: "Install tool dependencies"
- pwsh: |
node $(Build.SourcesDirectory)/eng/tools/generate-static-index/index.js
displayName: "Generate Index Toc"
- pwsh: |
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 JavaScript 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)/README.md" -Destination "$(Build.SourcesDirectory)/docfx_project/index.md" -Force
displayName: Update toc.yml and index
- pwsh: |
$(Build.BinariesDirectory)/docfx/docfx.exe build
displayName: Build Doc Content
workingDirectory: $(Build.SourcesDirectory)/docfx_project/
- pwsh: |
Copy-Item "$(Build.SourcesDirectory)/eng/tools/generate-static-index/static-files/assets/*" -Destination "$(Build.SourcesDirectory)/docfx_project/_site/" -Force
Get-Content "$(Build.SourcesDirectory)/eng/tools/generate-static-index/static-files/main.js" |Out-File "$(Build.SourcesDirectory)/docfx_project/_site/styles/main.js"
Get-Content "$(Build.SourcesDirectory)/eng/tools/generate-static-index/static-files/docfx.css" |Out-File "$(Build.SourcesDirectory)/docfx_project/_site/styles/docfx.css"
Copy-Item "$(Build.SourcesDirectory)/docfx_project/*" -Destination "$(Build.ArtifactStagingDirectory)/docfx_project/" -Recursive -Force
displayName: Replace site assets and Copy HTML to Artifacts Directory
- task: PublishPipelineArtifact@0
condition: succeeded()
inputs:
artifactName: "Doc.Index"
targetPath: $(Build.ArtifactStagingDirectory)/docfx_project/_site
17 changes: 5 additions & 12 deletions eng/pipelines/docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Pipeline variables:
# $(additionalArgs) eg : -i "exc" --exc arm-advisor arm-apimanagement OR -i "inc" --inc arm-advisor arm-apimanagement
# $(additionalArgs) eg : -i "exc" --exc advisor apimanagement OR -i "inc" --inc advisor apimanagement storage OR -i "inc" --inc eventhub --clientOnly

trigger:
- master
Expand Down Expand Up @@ -34,20 +34,13 @@ jobs:
displayName: "Install typedoc"
- script: |
npm install nunjucks
displayName: "Install nunjucks"
- script: |
npm install fs-extra
displayName: "Install fs-extra"
- script: |
npm install yargs
displayName: "Install yargs"
npm install
workingDirectory: $(System.DefaultWorkingDirectory)/eng/tools/generate-doc
displayName: "Install tool dependencies"
- pwsh: |
cd $(Build.SourcesDirectory)
node .\common\scripts\generate-doc.js --dgOp "dg" $(additionalArgs)
node .\eng\tools\generate-doc\index.js --dgOp "dg" $(additionalArgs)
Copy-Item -Path $(Build.SourcesDirectory)/docGen/* -Destination $(Build.ArtifactStagingDirectory) -Recurse -Force
displayName: "Generate Typedoc Docs"
Expand Down
Loading

0 comments on commit 211d751

Please sign in to comment.