Escape or change comments format

Skip to first unread message

Juan A. S.

Aug 12, 2016, 4:17:57 AM8/12/16
to Mako Templates for Python

I have created a script that takes files, with Markdown and Mako sentences. First, I render the template in mako, and then in Markdown. For example:

## Level 2 Title

% for i in [1, 2, 3]:
### Level 3 Title - ${i}
% endfor

The problem is that mako thinks that the lines starting with "##" are comments, when they are titles really. I know I can escape it with <%text>, but, is there any way to change the comment tag in mako? If not, I would have to change all the comment tags in the markdown files, and it would be more difficult to read.

Thanks in advance.

mike bayer

Aug 12, 2016, 10:08:18 AM8/12/16
Mako is not that extensible but you can add a preprocessor that
search-and-replaces for "##" lines and puts the <%text> around them.
> --
> You received this message because you are subscribed to the Google
> Groups "Mako Templates for Python" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
> <>.
> To post to this group, send email to
> <>.
> Visit this group at
> For more options, visit
Reply all
Reply to author
0 new messages