Browse Source

[chordpro] Template job is done by the template

pull/79/head
Louis 9 years ago
parent
commit
8f91044108
  1. 5
      patacrep/songs/chordpro/__init__.py
  2. 18
      patacrep/songs/chordpro/data/latex/song.tex

5
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,
}

18
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] ))},

Loading…
Cancel
Save