Browse Source

Add a pretty_chord property to Chord for HTML rendering

pull/103/head
Oliverpool 9 years ago
parent
commit
176db61929
  1. 5
      patacrep/songs/chordpro/ast.py
  2. 2
      patacrep/songs/chordpro/data/html/content_chord

5
patacrep/songs/chordpro/ast.py

@ -153,6 +153,11 @@ class Chord(AST):
# pylint: disable=too-many-arguments
self.chord = chord
@property
def pretty_chord(self):
"""Return the chord with nicer (utf8) alteration"""
return self.chord.replace('b', '').replace('#', '')
class Verse(AST):
"""A verse (or bridge, or chorus)"""
_template = "verse"

2
patacrep/songs/chordpro/data/html/content_chord

@ -1 +1 @@
((- content.chord -))
((- content.pretty_chord -))

Loading…
Cancel
Save