Browse Source

[WIP] Url rendering works

pull/213/head
Louis 9 years ago
parent
commit
ef58fb63e7
  1. 4
      patacrep/data/templates/songs/chordpro/chordpro/song_header
  2. 3
      patacrep/data/templates/songs/chordpro/latex/song
  3. 2
      test/test_song/special.csg
  4. 2
      test/test_song/special.csg.source
  5. 1
      test/test_song/special.tsg

4
patacrep/data/templates/songs/chordpro/chordpro/song_header

@ -33,6 +33,10 @@
{key: (( key.keyword )): (( key.argument|escape_specials('{}\\') ))} {key: (( key.keyword )): (( key.argument|escape_specials('{}\\') ))}
(* endfor *) (* endfor *)
(*- if 'url' in metadata -*)
{url: (( metadata.url ))}
(* endif -*)
(*- for chord in metadata['define'] *) (*- for chord in metadata['define'] *)
((- render(chord) )) ((- render(chord) ))
(* endfor *) (* endfor *)

3
patacrep/data/templates/songs/chordpro/latex/song

@ -27,6 +27,9 @@
(( key ))={(( metadata[key]|escape_specials('{}&#_^%~$\\') ))}, (( key ))={(( metadata[key]|escape_specials('{}&#_^%~$\\') ))},
(* endif *) (* endif *)
(* endfor *) (* endfor *)
(* if 'url' in metadata *)
url={(( metadata.url|escape_specials('%#') ))},
(* endif *)
(* if 'cover' in metadata *) (* if 'cover' in metadata *)
(* block cover *) (* block cover *)
(* set cover = metadata["cover"].argument|search_image|path2posix *) (* set cover = metadata["cover"].argument|search_image|path2posix *)

2
test/test_song/special.csg

@ -2,7 +2,7 @@
{title: & $ % # _ \} \{ ~ ^ \\} {title: & $ % # _ \} \{ ~ ^ \\}
{artist: & $ % # _ \} \{ ~ ^ \\} {artist: & $ % # _ \} \{ ~ ^ \\}
{album: & $ % # _ \} \{ ~ ^ \\} {album: & $ % # _ \} \{ ~ ^ \\}
{url: & $ % # _ \} \{ ~ ^ \\} {url: http://&$%#_~^}
& $ % \# _ \} \{ ~ ^ \\ & $ % \# _ \} \{ ~ ^ \\

2
test/test_song/special.csg.source

@ -1,7 +1,7 @@
{title: & $ % # _ \} \{ ~ ^ \\} {title: & $ % # _ \} \{ ~ ^ \\}
{artist: & $ % # _ \} \{ ~ ^ \\} {artist: & $ % # _ \} \{ ~ ^ \\}
{album: & $ % # _ \} \{ ~ ^ \\} {album: & $ % # _ \} \{ ~ ^ \\}
{url: & $ % # _ \} \{ ~ ^ \\} {url: http://&$%#_~^}
& $ % \# _ \} \{ ~ ^ \\ & $ % \# _ \} \{ ~ ^ \\

1
test/test_song/special.tsg

@ -4,6 +4,7 @@
by={ by={
\& \$ \% \# \_ \} \{ \textasciitilde{} \textasciicircum{} \textbackslash{} }, \& \$ \% \# \_ \} \{ \textasciitilde{} \textasciicircum{} \textbackslash{} },
album={\& \$ \% \# \_ \} \{ \textasciitilde{} \textasciicircum{} \textbackslash{}}, album={\& \$ \% \# \_ \} \{ \textasciitilde{} \textasciicircum{} \textbackslash{}},
url={http://&$\%\#_~^},
] ]

Loading…
Cancel
Save