diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-09-14 20:41:10 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-09-14 20:41:10 +0200 |
commit | c9d4ba22a8b6d0d5fb1062701eda8b1af554d422 (patch) | |
tree | 713c0fa3550bd4f7fbb0158a607651f6d95b28fb /reqs2tex.py | |
parent | 26feeb970b5ac98747d5a0321d23be01bbf024f8 (diff) |
WIP requirements
Diffstat (limited to 'reqs2tex.py')
-rwxr-xr-x | reqs2tex.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/reqs2tex.py b/reqs2tex.py new file mode 100755 index 0000000..68c8f40 --- /dev/null +++ b/reqs2tex.py @@ -0,0 +1,27 @@ +#!/bin/python3 +import sys, tomllib + +def fmt(data): + print(data) + return f""" +\\makeatletter +\\makeatother +""" + +def main(input_file): + data = {} + with open(input_file, "rb") as file: + data = tomllib.load(file) + + output = fmt(data) + + output_file = input_file.removesuffix(".toml") + ".tex" + with open(output_file, "w+") as file: + file.write(output) + +if __name__ == "__main__": + if len(sys.argv) != 2: + print("usage: reqs2tex.py reqs.toml") + exit(1) + main(sys.argv[1]) + |