Fixed whitespace behavior in generate.py
This commit is contained in:
parent
528ef21491
commit
3a3a0f42f2
1 changed files with 6 additions and 2 deletions
|
@ -26,7 +26,10 @@ modules = dict(map(read, module.glob('*.html')))
|
||||||
def format(item, modules):
|
def format(item, modules):
|
||||||
name, content = item
|
name, content = item
|
||||||
|
|
||||||
return (name, re.sub('\n\s*', '', content.format(**modules)))
|
content = content.format(**modules)
|
||||||
|
content = re.sub(r'\s+', ' ', content)
|
||||||
|
content = re.sub(r'>\s<', '><', content)
|
||||||
|
return (name, content)
|
||||||
|
|
||||||
dist_html = dict(map(lambda item: format(item, modules), templates.items()))
|
dist_html = dict(map(lambda item: format(item, modules), templates.items()))
|
||||||
|
|
||||||
|
@ -42,4 +45,5 @@ def mk_dist(dist, item):
|
||||||
for item in dist_html.items():
|
for item in dist_html.items():
|
||||||
mk_dist(dist, item)
|
mk_dist(dist, item)
|
||||||
|
|
||||||
dist.joinpath('static').symlink_to(static.resolve(strict=True), target_is_directory=True)
|
dist.joinpath('static')\
|
||||||
|
.symlink_to(static.resolve(strict=True), target_is_directory=True)
|
||||||
|
|
Reference in a new issue