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', 'lang',
self.cached['song'].get_data_argument('language', 'english'), 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)), "path": files.relpath(self.fullpath, os.path.dirname(output)),
"titles": r"\\".join(self.titles), "titles": self.titles,
"authors": ", ".join(["{} {}".format(name[1], name[0]) for name in self.authors]), "authors": self.authors,
"metadata": self.data, "metadata": self.data,
"render": self.render_tex, "render": self.render_tex,
} }

18
patacrep/songs/chordpro/data/latex/song.tex

@ -8,8 +8,22 @@
(* endif *) (* endif *)
\songcolumns{(( metadata.columns ))} \songcolumns{(( metadata.columns ))}
\beginsong{((titles))}[ \beginsong{
by={((authors))}, (*- 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'] *) (* for key in ['album', 'copyright', 'cov', 'vcov', 'tag'] *)
(* if key in metadata *) (* if key in metadata *)
(( key ))={(( metadata[key] ))}, (( key ))={(( metadata[key] ))},

Loading…
Cancel
Save