By the book
Meaning / Explanation:
The meaning of this phrase is doing something correctly and according to the rules. If something is done accordingly to rules and procedures it means doing something by the book.
Origin / Source
That may be so, as the early meaning of the phrase was ‘I swear it to be true’, as in the oaths taken in courtrooms. An example of that usage, is recorded in The Times, January 1833:
“Patience in troth! By the book, it’s myself is the moral o’ patience!”
The present meaning also emerged around the same time. The earliest citation I can find is from the mid-19th century – in Edgar Allan Poe’s Murders in Rue Morgue, 1845:
Example
Robin was so strict and disciplined that he likes doing everything by the books.