As a software engineer I love to work with source code that comes with Unit Tests and a well written documentation. Markdown is surely a good way to write your documents. But sometimes it comes in handy to have a shiny PDF to store offline, send via email or print in high resolution. For those cases Docbook (co-founder O’Reilly Media) is a good solution because it supports different output formats like pdf, epub or html. My project livingfire-docbook shows a easy way to get started with Docbook and alter this example for your own needs. The software can also covert Markdown to Docbook using pandoc and combine multiple Markdown files like a GitLab Wiki into one PDF. In addtion to that you can write UML diagrams in PlantUML and have them rendered into pictures in your book.
See GitHub project page for more information.