using template to generate book contents