I know how to create a ebook but I will only look at the code if something is wrong in the display of the book and needs to be fixed.
Most of the time Calibre can do this automatically with Search and Replace. Sometimes it can't and I have to open the book up in Word and fix it up nicely.
Every book I run through Calibre to add navigation, indentation, smarten punctuation and remove fonts and colors. I also add a blank line after every paragraph to make it more readable for me.