Skip to content

Instantly share code, notes, and snippets.

@dmfs
dmfs / preprocess_wiki.py
Last active August 29, 2015 14:27
A quick and dirty proof of concept to pre-process tags & templates in davwiki
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)