Choose an not too thin book, which you don't want to read anymore.
Open the book on about page thirty and take your ruler to frame the page in a 1 inch frame.
Mark the frame with a pencil
Now cut along your lines. To make the lines straight use a ruler. Depending on the thickness of the paper you'll be able to cut about ten pages at once.
Make the compartment as deep as you need it to be, make sure not to go all the way to the end of the book, otherwise the compartment won't be that stable.
When your compartment is deep enough, glue the last ten "whole" pages together to make a bottom for the compartment.
You won't need to glue every single page together that would be too much work. Just spread the glue on the walls of the compartment. Then close the book and put weights on it ( books , etc.)
Let it dry ( depending on the glue , mine took about 12 hours ) Put on another layer of glue when it's dry. Make sure the walls are stable, if not.... More glue !
Your secret book compartment is done! Put it in your bookshelf and no one will guess that you have your chocolate hidden in a book ;)