Skip to content
Browse files
Implement invariance in charts properly
Signed-off-by: Chris Warrick <>
  • Loading branch information
Kwpolska committed Aug 25, 2015
1 parent 4b05d26 commit 84f62cbfaab8ed51854f127e3318d5b822437f64
Showing 1 changed file with 2 additions and 4 deletions.
@@ -152,13 +152,11 @@ def run(self):
options[k] = literal_eval(v)

chart = getattr(pygal, self.arguments[0])(style=style)
if _site and _site.invariant:
chart.no_prefix = True
for line in self.content:
label, series = literal_eval('({0})'.format(line))
chart.add(label, series)
data = chart.render().decode('utf8')
if _site and _site.invariant:
import re
data = re.sub('id="chart-[a-f0-9\-]+"', 'id="chart-foobar"', data)
data = re.sub('#chart-[a-f0-9\-]+', '#chart-foobar', data)
return [nodes.raw('', data, format='html')]

0 comments on commit 84f62cb

Please sign in to comment.