squash
This commit is contained in:
parent
3d3b8da3af
commit
8885969e90
5 changed files with 371 additions and 0 deletions
41
build.py
Executable file
41
build.py
Executable file
|
@ -0,0 +1,41 @@
|
|||
#! /usr/bin/env python3
|
||||
"""Build web."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from rwx.fs import make_directory, read_file_text, write
|
||||
from rwx.ps import run
|
||||
|
||||
if __name__ == "__main__":
|
||||
root = Path(__file__).parent
|
||||
out = root / "out" / "web"
|
||||
gv = root / "index.gv"
|
||||
svg = out / "index.svg"
|
||||
make_directory(out)
|
||||
run("dot", str(gv), "-Tsvg", "-o", str(svg))
|
||||
text = read_file_text(svg)
|
||||
write(
|
||||
out / "index.css",
|
||||
"""\
|
||||
html {
|
||||
background-color: #202020;
|
||||
}
|
||||
""",
|
||||
)
|
||||
write(
|
||||
out / "index.html",
|
||||
f"""\
|
||||
<!DOCTYPE html>
|
||||
<html><head>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="index.css">
|
||||
<title>todo.rwx.work</title>
|
||||
|
||||
</head><body>
|
||||
|
||||
{text}
|
||||
|
||||
</body></html>
|
||||
""",
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue