How I wrote this book?
I blog since 2007, that is: .
Every page on this book has one or multiple links to blog posts I did on the past.
I wrote this book in a very different way compared with my 3 previous books. My 3 previous books we're written in a formal way. This one was written in a very different way. Let's explain the "formal process" and how usually it worked for me:
- You need to write a proposal, proposal get debated and approved, you write.
- Formal books have length requirements usually 300 pages.
- Formal books once approved are waterfall and have several phases.
- Once you deliver a chapter, there is an english reviewer.
- After the english reviewer there is the technical reviewer.
- After that there is copy-writing, index, layouting and finally printing.
- Traditional process take from 7 to 12 months.
- I wrote books alone and with other people, more people you have, more coordination you need and longer it takes, more things can go wrong, it's literally no different than a project.
I want a different experience; I did several things differently here. I'm not saying I would never do traditional books again, but for sure it's different; there are some things here I like a lot, for instance:
- Because I used
mdbook, the book is written with a tool in Rust which is markdown based. - Mdbook has 3 killer features for me:
- It has a built-in search engine, and a very good one.
- It provides a direct link to all pages of the book; every page has a unique URL.
- It has a built-in way to generate code snippets with syntax highlighting, videos, and themes.
- The book is hosted on git. Meaning I have version control over all the changes of the book; want to see what I did differently? just use git.
- If I want to say something different, on the traditional book I need to write a new book and people need to buy it to read it; here I just do a
git pushand it's live, because I have a workflow with GitHub Actions to publish the book on a GitHub Pages site. - It's also a way for me to give back for free.
What tools did I use?
I basically use VSCode to write the book. I used Github Copilot and Claude Code.
I did not use AI to generate the entire book. The book is mine, all content I wrote but I use AI to generate the following content:
- Index
- Glossary
- References
- Spell check and proofreading my english (fix typos and fix grammar issues never to wrote whole paragraphs).
I used claude code custom commands to do all this tasks, I create a book-all custom command that automated all those workflows:
book-all.md
## Perform several Tasks to publish my book
- Read all markdown files
- Perform the following tasks
## Task 1 - # Create or Update my Glossary
- My glossary is on a GLOSSARY.md
- Make sure my glossary is up to date
## Task 2 - # Create or Update my References
- My references are in REFERENCES.md
- Make sure my external references/links are up to date
## Task 3 - # Create or update my book index
- Index is on a file INDEX.MD
- Make sure my index is up to date
## Task 4 - # Create or update book CHANGELOG.md
- Read commits from git history
- Make sure the changelog has meaning
- Only look for markdown files, ignore *.html.
## Task 5 - # Fix my english
- Fix all my english issues
- Fix my typos
- Don't touch the HTML files only the markdown files
- Only fix english or grammar mistake, don't change my words or writing style
- Make sure you don't break anything, make sure you don't lose content
## Task 6 - # Make sure you did not lose content
- You cannot lose content
- Make sure you did not break links
- Make sure all content is there
- Make sure you did not delete anything wrongly
Running this custom command uses on avg ~70k tokens. So I use AI for the boring and repetitive tasks, not to write the book itself. When I run out of tokens on Claude Code, I would fall back to GitHub Copilot. For this book I tried copilot cli as a fallback to claude code when I run out of tokens. It mostely worked but created some bugs like made the pages flat, losing the folder structure. So I had to fix that manually.
CI/CD
This book was written with CI/CD in mind from day one. I have a script called bump-version.sh that bumps the version of the book in a file at the root called "VERSION". When I released the book, it had ~160 pages on version 1.0.0, took me 13 days to them written. More to come.
This is a killer feature because I can keep releasing new content in a very lean/agile way, directly to you the reader.
Did you like my work? Did it help you?
If you like my work, you can help me by buying one of my other books here:
- Continuous Modernization
- Principles of Software Architecture Modernization
- Building Applications with Scala
You can also help me by sharing this book in social media on X, LinkedIn, Facebook, Reddit, Hacker News, or any other place you like.