'Generate the format args for template substitution.
self.load_section_templates imports string formatting templates of the form
\'by_*_template.py\' for use in the various sections. The templates are designed to use
format args, supplied by this method.
Args:
book (dict): book metadata
Return:
(dict): formatted args for templating'

def generate_format_args(self, book):

    series_index = str(book['series_index'])
    if series_index.endswith('.0'):
        series_index = series_index[:(-2)]
    args = dict(title=book['title'], series=book['series'], series_index=series_index, rating=self.generate_rating_string(book), rating_parens=(('(%s)' % self.generate_rating_string(book)) if ('rating' in book) else ''), pubyear=(book['date'].split()[1] if book['date'] else ''), pubyear_parens=(('(%s)' % book['date'].split()[1]) if book['date'] else ''))
    return args
