Exporting Release Notes and WIKIs as PDFs using a new Azure DevOps Extension that wrappers AzureDevOps.WikiPDFExport
A common question I get when people are using my Release Notes task for Azure DevOps is whether it is possible to get the release notes as a PDF. In the past, the answer was that I did not know of any easy way. However, I have recently come across a command line tool by Max Melcher called AzureDevOps.WikiPDFExport that allows you to export a whole WIKI (or a single file) as a PDF. Its basic usage is
- Clone a WIKI Repo
- Run the command line tool passing in a path to the root of the cloned repo
- The .order file is read
- A PDF is generated
This is a nice and simple process, but it would be nice to be able to automate this process as part of a build pipeline. After a bit of thought, I realised I had much of the code I needed to automated the process in my WIKIUpdater extension as these tasks are based around cloning repos. So I am please to say I have just released a new Azure DevOps extension WikiPDFExport that wrappers Max’s command line tool. It does the following
- Downloads the latest release of the WikiPDFExport tool from GitHub to the build agent (the exe is too big to include in the VSIX package)
- Optionally clone a Git based WIKI repo. As with my WikIUpdater tasks, you can pass credentials for Azure DevOps or GitHub
- Generate a PDF of a single file or the whole of a Wiki folder structure (based on the .order file) that was either cloned or was already present on the agent
A sample of the YAML usage of the task is as shown below. For full documentation see the extensions wiki pages for general usage and troubleshooting and the full YAML specification``` - task: richardfennellBM.BM-VSTS-WikiPDFExport-Tasks.WikiPDFExportTask.WikiPdfExportTask@1 displayName: 'Export Single File generated by the release notes task' inputs: cloneRepo: false localpath: '$(System.DefaultWorkingDirectory)' singleFile: 'inline.md' outputFile: '$(Build.ArtifactStagingDirectory)PDFsingleFile.pdf'
- task: richardfennellBM.BM-VSTS-WikiPDFExport-Tasks.WikiPDFExportTask.WikiPdfExportTask@1 displayName: 'Export a public GitHub WIKI' inputs: cloneRepo: true repo: 'https://github.com/rfennell/AzurePipelines.wiki.git' useAgentToken: false localpath: '$(System.DefaultWorkingDirectory)GitHubRepo' outputFile: '$(Build.ArtifactStagingDirectory)PDFpublicGitHub.pdf'
- task: richardfennellBM.BM-VSTS-WikiPDFExport-Tasks.WikiPDFExportTask.WikiPdfExportTask@1 displayName: 'Export a private Azure DevOps WIKI' inputs: cloneRepo: true repo: 'https://dev.azure.com/richardfennell/GitHub/_git/GitHub.wiki' useAgentToken: true localpath: '$(System.DefaultWorkingDirectory)AzRepo' outputFile: '$(Build.ArtifactStagingDirectory)PDFAzrepo.pdf'