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('{}\\') ))}
(* endfor *)
(*- if 'url' in metadata -*)
{url: (( metadata.url ))}
(* endif -*)
(*- for chord in metadata['define'] *)
((- render(chord) ))
(* endfor *)

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

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

2
test/test_song/special.csg

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

2
test/test_song/special.csg.source

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

1
test/test_song/special.tsg

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

Loading…
Cancel
Save