Chapter 8: Tools and Workflow

The right tools won’t write your book for you, but the wrong tools will slow you down, introduce friction, and create problems you don’t need. This chapter covers the toolchain and workflow that support a smooth writing process for technical books.


Choosing a Writing Format

The format you write in determines what tools you can use, how easily you can collaborate, and what publishing options are available.

Markdown

Best for: Self-published books, developer-oriented content, open-source books.

Pros:

Cons:

AsciiDoc

Best for: Books published through O’Reilly (their publishing platform supports AsciiDoc natively) or those needing richer formatting than Markdown.

Pros:

Cons:

LaTeX

Best for: Academic and mathematical content. Books heavy on equations and formal notation.

Pros:

Cons:

Word Processors (Google Docs, Word)

Best for: Collaboration with non-technical editors. Working with traditional publishers who expect Word manuscripts.

Pros:

Cons:

Recommendation

For most technical books aimed at a developer audience, Markdown or AsciiDoc with Git version control is the best choice. You get the benefits of plain text (diffable, mergeable, portable) with enough formatting power for technical content.

The Writing Environment

Text Editor or IDE

Use whatever you are comfortable writing prose in. Popular choices:

The key feature you need: live preview of formatted output so you can see what your reader will see.

Spell Checking and Grammar

Distraction Management

Writing requires sustained focus. Consider:

Version Control

Use Git

Track your manuscript in Git. Full stop. This gives you:

Repository Structure

A clean structure for a book repository:

my-technical-book/
  chapters/
    01-introduction.md
    02-getting-started.md
    ...
  code/
    chapter-01/
    chapter-02/
    ...
  images/
    chapter-01/
    chapter-02/
    ...
  appendices/
    a-setup-guide.md
    b-reference.md
  book.yaml          # Metadata (title, author, description)
  bibliography.md    # Sources and references
  glossary.md        # Terms and definitions
  Makefile            # Build commands
  README.md

Commit Practices

Building and Previewing

Pandoc

Pandoc is the Swiss Army knife for document conversion. It converts Markdown to PDF, EPUB, HTML, DOCX, and more.

Basic usage:

pandoc chapter-01.md -o chapter-01.pdf

For a full book with metadata and styling:

pandoc --metadata-file=book.yaml \
       --toc \
       --number-sections \
       chapters/*.md \
       -o book.pdf

mdBook

If you are writing for a web audience, mdBook generates a clean, navigable website from Markdown files. Ideal for open-source books hosted on GitHub Pages.

Honkit / GitBook

Similar to mdBook but with more features. Produces both web and PDF/EPUB output.

Custom Build Scripts

As your build process gets more complex (preprocessing code examples, generating diagrams, running tests), wrap it in a Makefile or build script:

build-pdf:
    pandoc --metadata-file=book.yaml chapters/*.md -o output/book.pdf

build-epub:
    pandoc --metadata-file=book.yaml chapters/*.md -o output/book.epub

test-code:
    cd code && pytest

all: test-code build-pdf build-epub

Managing Code Examples

Keep Code and Prose Separate

Store code examples in their own directory, not embedded only in the manuscript. This lets you:

Automated Testing

Set up CI (GitHub Actions, GitLab CI) to:

  1. Run all code examples.
  2. Run linters on code.
  3. Build the manuscript to catch formatting errors.

This catches broken examples early, before they reach readers.

Code Inclusion

Some tools let you include external code files in your manuscript:

AsciiDoc:

[source,python]
----
include::code/chapter-01/example.py[]
----

This means you only maintain one copy of each example, and it’s the one that gets tested.

Backup Strategy

Your manuscript is months of work. Protect it.

Losing a manuscript to a hard drive failure is a preventable disaster.

Collaboration Workflow

Working With Co-Authors

If you have a co-author:

Working With Editors

If your editor doesn’t use Git:

If your editor can use Git:


Key Takeaways


← Chapter 7: Editing and Technical Review Table of Contents Chapter 9: Publishing Options →