I enjoyed using Asciidoctor to write a book. It necessitates using a text editor instead of a word processor so it doesn't fit DJ's use case, but it really is quite nice.
I'm also fascinated by the build for Ada & Zangemann, a FOSS illustrated full-color children's book. It looks rather complex, but it handles translations, beautiful typesetting, and was remarkably fast when I tried running the build locally.
Many other tools/platforms provide decent source control and issue tracking. Nothing else has the FOSS project market share of github, and this matters especially when you're looking for the canonical home of a project and trying to judge how popular/active/viable it is (stars/commits/issues/PRs).
If you want exposure and participation for your FOSS project, it's harder to not use github.
FWIW, Forgejo does the source control stuff well. I love it for self-hosted local mirrors.
Hard pass. Another Linux laptop with another sus distro won't teach anyone how to focus. Save a hand-me-down laptop from the landfill, install a known good distro, and do the hard work of culling distractions.
You're right to start with your requirements. Try to get detailed, like the list @WA wrote out, then match it up with appropriate tech.
I wrote a technical book and I also wanted multiple decent-looking outputs. In my case: HTML, EPUB/mobi, screen and print PDFs. I was struggling with Markdown+pandoc+custom scripts/styles, so I switched to Asciidoc. I wrote about that process here: https://adammonsen.com/post/2122/
Here are two examples where the author used Markdown and the result was beautiful and successful (although layout for printed editions were done with extra/other tooling): http://gameprogrammingpatterns.com , http://www.craftinginterpreters.com . I'm curious if Bob would/will use Markdown for his next book. My process is different than Bob's... I didn't need literate code and I didn't want to do _any_ layout/pre/post-processing, even for print. Asciidoctor worked for this, although there were some compromises (see my links above). Print-ready layout is a lot of work, however you do it.
Is this your first book? Do you have a publisher? Will it be printed on paper? Do you have a developmental editor / proofreader / etc? Do you have a plan for what you'll do after you publish e.g. talks/promos/tour?
Contact me if you want to chat. I'm happy to share my war stories. And good luck!
Another great one: The Confidence Game by Maria Konnikova.