Instantly share code, notes, and snippets.

View preprocess_wiki.py
from collections import defaultdict
from jinja2 import Environment, FileSystemLoader, Template
import json
import os
import re
# a pattern that matches tags in the form of
# <!-- --- tagname: tagvalue -->
simple_tag_pattern = re.compile('<!--\s*---\s*([^:\s]+):\s*(.*?)\s*-->', re.DOTALL)