From 8f910441080f4255dc12821d9e7352f7b85fb6c6 Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 28 Aug 2015 20:09:03 +0200 Subject: [PATCH] [chordpro] Template job is done by the template --- patacrep/songs/chordpro/__init__.py | 5 ++--- patacrep/songs/chordpro/data/latex/song.tex | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/patacrep/songs/chordpro/__init__.py b/patacrep/songs/chordpro/__init__.py index d594a0b3..d5efd135 100644 --- a/patacrep/songs/chordpro/__init__.py +++ b/patacrep/songs/chordpro/__init__.py @@ -34,10 +34,9 @@ class ChordproSong(Song): 'lang', self.cached['song'].get_data_argument('language', 'english'), ), - #'columns': self.cached['song'].get_data_argument('columns', 1), "path": files.relpath(self.fullpath, os.path.dirname(output)), - "titles": r"\\".join(self.titles), - "authors": ", ".join(["{} {}".format(name[1], name[0]) for name in self.authors]), + "titles": self.titles, + "authors": self.authors, "metadata": self.data, "render": self.render_tex, } diff --git a/patacrep/songs/chordpro/data/latex/song.tex b/patacrep/songs/chordpro/data/latex/song.tex index 8da583af..a4f4d9ca 100644 --- a/patacrep/songs/chordpro/data/latex/song.tex +++ b/patacrep/songs/chordpro/data/latex/song.tex @@ -8,8 +8,22 @@ (* endif *) \songcolumns{(( metadata.columns ))} -\beginsong{((titles))}[ - by={((authors))}, +\beginsong{ + (*- for title in titles -*) + (( title )) + (*- if not loop.last -*) + \\ + (* endif *) + (* endfor -*) +}[ + by={ + (* for author in authors *) + (( author[1] )) (( author[0] )) + (*- if not loop.last -*) + , + (* endif *) + (* endfor *) + }, (* for key in ['album', 'copyright', 'cov', 'vcov', 'tag'] *) (* if key in metadata *) (( key ))={(( metadata[key] ))},