Self-publishing an engineering book on Amazon Kindle is a very different beast than writing a blog post.
The Code Formatting Problem
Kindle screens reflow text dynamically, which can ruin code indentation if you aren't careful. I had to learn how to structure snippets into high-contrast SVG diagrams and carefully tested pre-formatted code blocks.
If you are thinking of publishing technical books on Amazon, always preview your manuscript on both e-ink Kindle devices and standard mobile screens.