From 2791f7f8fb5e806bfbaa5079d49368e7490e7a22 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 28 Mar 2023 21:29:54 +0200 Subject: [PATCH] build --- build.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 build.py diff --git a/build.py b/build.py new file mode 100755 index 0000000..e800202 --- /dev/null +++ b/build.py @@ -0,0 +1,27 @@ +#! /usr/bin/env python3 + +import os +import subprocess + + +def run(*args): + subprocess.call(args) + + +def main(): + root = os.path.dirname(os.path.realpath(__file__)) + link_gv = os.path.join(root, 'link.gv') + link_svg = os.path.join(root, 'link.svg') + run('dot', link_gv, '-Tsvg', '-o', link_svg) + with open(link_svg, 'br') as f: + link_text = f.read().decode('u8') + page_file = os.path.join(root, 'test.html') + page_text = f'''\ +{link_text} +''' + with open(page_file, 'bw') as f: + f.write(page_text.encode('u8')) + + +if __name__ == '__main__': + main()