Azure DevOps has undoubtedly a great wiki. Markdown support, copy and paste of screenshots transparently managed by git - awesome. Surprisingly, a ‘export as PDF’ functionality is missing so I decided to create a small tool.
It started as a tiny proof of concept and took no longer as 1 hour to hack it together - a small, self-contained .NET Core console tool that converts a Azure DevOps wiki to a PDF.
Currently, the tool has only basic features - and maybe it stays like this forever. The feature-set is the following:
- Export all wiki pages (and sub pages) in the correct order including styles and formatting.
- Includes pictures (remote and relative urls)
- Creates PDF bookmarks to all pages for easier navigation within the PDF
- If you link to other wiki pages, the link in the PDF will work, too.
- Everything self-contained. Download the .exe file, run it, done.
- Tool can be used as part of a build, see Build Task
- It is fast: A wiki with 160 pages is created in less than a second.
I put the source code in an public Azure DevOps project: https://dev.azure.com/mmelcher/AzureDevOps.WikiPDFExport
The latest version of the tool can be downloaded here. With VSCode and .NET Core 2.2 installed, you can build it by yourself, too.
The tool is MIT licensed:
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
I use a couple of other great open source libraries:
- CommandLineParser to parse the command line
- MarkDig to parse markdown files to HTML.
- DinkToPdf to export HTML to PDF
- dotnet-warp to release a self-contained exe file
Building this tiny tool was good fun and I learned a lot, again. I build the tool entirely with VSCode and I have to say, that was an awesome experience! So lean :)
So, go create some PDFs - but please don’t PRINT them.