diff --git a/cmake-modules/doxygen_common.cmake b/cmake-modules/doxygen_common.cmake index b711ff2d3..b3e15a7d2 100644 --- a/cmake-modules/doxygen_common.cmake +++ b/cmake-modules/doxygen_common.cmake @@ -21,6 +21,7 @@ function(generate_documentation PROJECT_NAME PROJECT_VERSION) set(DOXYGEN_HTML_FOOTER ${CMAKE_SOURCE_DIR}/eng/docs/api/assets/footer.html) set(DOXYGEN_HTML_STYLESHEET ${CMAKE_SOURCE_DIR}/eng/docs/api/assets/style.css) + set(DOXYGEN_GENERATE_XML YES) set(DOXYGEN_GENERATE_LATEX NO) # Use MathJax instead of latex to render formulas set(DOXYGEN_USE_MATHJAX YES) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index ef107e444..135395d66 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -120,6 +120,9 @@ jobs: -DBUILD_CURL_TRANSPORT=OFF -DBUILD_DOCUMENTATION=YES + - pwsh: npm install -g moxygen + displayName: Install Moxygen to generate markdown for docs.microsoft.com + # Generate package spec JSON files for tagging the repo - ${{ each artifact in parameters.Artifacts }}: - pwsh: >- @@ -156,7 +159,20 @@ jobs: workingDirectory: build displayName: Generate docs (${{ artifact.Name }}-docs) - - pwsh: New-Item -ItemType directory -Path $(Build.ArtifactStagingDirectory) -Name docs/${{ artifact.Name }} + - task: PowerShell@2 + inputs: + targetType: filePath + filePath: eng/scripts/New-DocsMsArtifact.ps1 + arguments: >- + -ServiceDirectory ${{ parameters.ServiceDirectory }} + -PackageName ${{ artifact.Name }} + -TargetFolder $(Build.ArtifactStagingDirectory)/packages/${{ artifact.Name }}/docs/docs.ms + ignoreLASTEXITCODE: true + pwsh: true + displayName: Generate artifacts for docs.ms + + - pwsh: | + New-Item -ItemType directory -Path $(Build.ArtifactStagingDirectory) -Name docs/${{ artifact.Name }} displayName: Create doc artifact location - task: CopyFiles@2 @@ -177,7 +193,7 @@ jobs: artifactName: packages path: $(Build.ArtifactStagingDirectory)/packages - # After all docs artifacts are generated publis docs artifacts + # After all docs artifacts are generated publish docs artifacts - task: PublishPipelineArtifact@1 inputs: artifactName: docs diff --git a/eng/scripts/New-DocsMsArtifact.ps1 b/eng/scripts/New-DocsMsArtifact.ps1 new file mode 100644 index 000000000..eee3d261c --- /dev/null +++ b/eng/scripts/New-DocsMsArtifact.ps1 @@ -0,0 +1,16 @@ +[CmdletBinding()] +Param ( + [ValidateNotNullOrEmpty()] + [string] $RepoRoot = "${PSScriptRoot}/../..", + [Parameter(Mandatory=$True)] + [string] $ServiceDirectory, + [Parameter(Mandatory=$True)] + [string] $PackageName, + [string] $TargetFolder = "$RepoRoot/build/sdk/$ServiceDirectory/$PackageName/docs/docs.ms" +) + +npm install -g moxygen + +$docsPath = "$RepoRoot/build/sdk/$ServiceDirectory/$PackageName/docs" +New-Item -ItemType directory -Path $TargetFolder -Force +moxygen --anchors --output "$TargetFolder/api-docs.md" "$docsPath/xml"