Merge pull request #286 from shawno1059/master
[dygraphs.git] / docs / ssi.py
1 '''
2 Shared code for ssi_server.py and ssi_expander.py.
3 '''
4
5 import re
6
7 def InlineIncludes(path):
8 """Read a file, expanding <!-- #include --> statements."""
9 content = file(path).read()
10 content = re.sub(r'<!-- *#include *virtual=[\'"]([^\'"]+)[\'"] *-->',
11 lambda x: file(x.group(1)).read(),
12 content)
13 return content
14