# -*- coding: utf-8 -*- import re from lektor.pluginsystem import Plugin _prefix_re = re.compile(r'^\s*(!{1,4})\s+') CLASSES = { 1: 'note', 2: 'info', 3: 'tip', 4: 'warning', } class AdmonitionMixin(object): def paragraph(self, text): match = _prefix_re.match(text) if match is None: return super(AdmonitionMixin, self).paragraph(text) level = len(match.group(1)) return '
%s