I write the content for the books (words and code) using a text editor, specifically sublime.
I typeset the books and create a PDF using LaTeX.