summaryrefslogtreecommitdiff
path: root/justfile
blob: be83f99898fa49f09c1ceb4fdba172fd41db5a81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
format filename:
    #!/usr/bin/env python3
    import re
    with open("{{filename}}") as f:
        m = re.search("^# (.*)", f.read())
        title = "Презентация" if m is None else m.group(1)
    with open("template.html") as f:
        template = f.read()
    with open("index.html", "w") as f:
        f.write(template % (title, "{{filename}}"))

serve filename port="8000": (format filename)
    python3 -m http.server {{port}}