Leaf out of the book

I would like to know the meaning of the phrase:

To take a leaf out of the book.

the pages of books are also called 'leaves' and the book is a metaphor for 'example' - so 'my book' in the example is like a manual for living (or history) and offering a page/leaf is to offer oneself as an example to copy.

L