From e6d48b4ad6ba6d7dbceb95e7b80e092feb5a80ad Mon Sep 17 00:00:00 2001 From: Ryan Kelly Date: Sat, 30 Apr 2011 09:58:49 +1000 Subject: [PATCH] {% syntax %} tag: optionally disable generation of
container --- hyde/ext/templates/jinja.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hyde/ext/templates/jinja.py b/hyde/ext/templates/jinja.py index 5fa3f51..6e86e1a 100644 --- a/hyde/ext/templates/jinja.py +++ b/hyde/ext/templates/jinja.py @@ -131,6 +131,9 @@ def syntax(env, value, lexer=None, filename=None): code = pygments.highlight(value, pyg, formatter) code = code.replace('\n\n', '\n \n').replace('\n', '
') caption = filename if filename else pyg.name + if hasattr(env.config, 'syntax'): + if not getattr(env.config.syntax, 'use_figure', True): + return Markup(code) return Markup( '
%s
%s
\n\n' % (code, caption))