One writer recently wrote his own program for the job, but at least he eventually finished some books: https://hughhowey.com/neo/
Me, I just write in Emacs, set up a makefile, and export to PDF with Pandoc. But I admire the work to make a comfortable yet undistracting writing environment.
He just vibe coded it.