From 8249280b031667f46751a8772f9e04ecda46696d Mon Sep 17 00:00:00 2001 From: veclav talica Date: Mon, 22 May 2023 14:11:10 +0500 Subject: [PATCH] shell script based compilation --- compile.py | 14 -------------- compile.sh | 11 +++++++++++ 2 files changed, 11 insertions(+), 14 deletions(-) delete mode 100755 compile.py create mode 100755 compile.sh diff --git a/compile.py b/compile.py deleted file mode 100755 index 10172d3..0000000 --- a/compile.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/python3 - -from os import walk -import subprocess - -subprocess.run("./tools/main_page_generator.py ./articles | ./tools/mmd/build/multimarkdown > ./html/index.html", shell=True) -subprocess.run("mkdir -p ./html/articles", shell=True) - -for root, dirs, _ in walk("./articles"): - for d in dirs: - subprocess.run( - f"""./tools/article_wrapper.py ./articles/{d}/page.mmd | ./tools/mmd/build/multimarkdown > ./html/articles/{d}.html""", - shell=True - ) diff --git a/compile.sh b/compile.sh new file mode 100755 index 0000000..0a08067 --- /dev/null +++ b/compile.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +mkdir -p ./html/articles + +./tools/main_page_generator.py ./articles | ./tools/mmd/build/multimarkdown > ./html/index.html + +for d in ./articles/*; do + if [ -d "$d" ]; then + ./tools/article_wrapper.py "$d/page.mmd" | ./tools/mmd/build/multimarkdown > "./html/articles/$(basename -- $d).html" + fi +done