From f0fafb33bd8b651cacb66a4e1c02a5d5c235bf70 Mon Sep 17 00:00:00 2001 From: veclav talica Date: Tue, 23 May 2023 21:38:25 +0500 Subject: [PATCH] track listing generator and its integration --- compile.sh | 2 + tools/page_shares.py | 1 + tools/track_listing_generator.py | 80 ++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100755 tools/track_listing_generator.py diff --git a/compile.sh b/compile.sh index 4f67219..2be054f 100755 --- a/compile.sh +++ b/compile.sh @@ -13,3 +13,5 @@ for d in ./articles/*; do done ./tools/feed_generator.py ./articles/ https://mjestecko.neocities.org/ > ./html/feed.xml + +./tools/track_listing_generator.py html/tracks > html/tracks.html diff --git a/tools/page_shares.py b/tools/page_shares.py index 0af4d71..f4b0fe6 100644 --- a/tools/page_shares.py +++ b/tools/page_shares.py @@ -9,6 +9,7 @@ HEAD_EMBED = """ diff --git a/tools/track_listing_generator.py b/tools/track_listing_generator.py new file mode 100755 index 0000000..4f086fb --- /dev/null +++ b/tools/track_listing_generator.py @@ -0,0 +1,80 @@ +#!/usr/bin/python3 + +from sys import argv, exit +from os import walk, path + +if len(argv) <= 1: + print("No directory was supplied") + exit(-1) + +page = """ + + + + Tracks + + + + + + +
+
+

mjestečko

+ +
+ +
+

Tracks

+

.xm module tracks of my own. Btw, they're playable in browser :3

+

Note that some files are rendered incorrectly.

+
+""" + +for _, _, files in walk(argv[1]): + files.sort() + for f in files: + if not f.endswith('.xm'): + continue + page += ( + f"""

{f}

\n""" + "
\n" + ) + +page += """
+
+ + +""" + +print(page)