diff --git a/build.py b/build.py deleted file mode 100644 index 8d04584..0000000 --- a/build.py +++ /dev/null @@ -1,325 +0,0 @@ -#!/usr/bin/env python3 -"""Combine all numbered page files into a single index.html.""" -import os -import re - -def build_index(title, DIR): - # Collect numbered pages, sorted numerically - page_nums = sorted( - int(m.group(1)) - for f in os.listdir(DIR) - if (m := re.match(r'^(\d+)\.html$', f)) - ) - - def read_page(n): - with open(os.path.join(DIR, f'{n}.html'), encoding='utf-8') as f: - content = f.read() - content = re.sub(r'[ \t]*]+>\n?', '', content) - return content.strip() - - sections = [(n, read_page(n)) for n in page_nums] - - sidebar_items = '\n '.join( - f'
' - for n in page_nums - ) - - sections_html = '\n\n '.join( - f'