1
0

Styling + chapter 1

This commit is contained in:
2026-05-17 21:42:48 +02:00
parent d3637e8758
commit 3305a89c63
5 changed files with 186 additions and 9 deletions

View File

@@ -59,7 +59,14 @@ find . -type f -name "*.md" -print0 | while IFS= read -r -d '' mdfile; do
{
echo "$HTML_BEGIN"
sed -E 's/href="(\.\/[^.]+)"/href="\1\/"/g' "$html_raw" | \
python3 -c "import sys, re; print(re.sub(r'href=\"([^\"]+)\"', lambda m: 'href=\"' + m.group(1).replace('?', '%3F').replace('!', '%21') + '\"', sys.stdin.read()), end='')"
sed -E 's/href="([^"]*)\.md"/href="\1.html"/g' | \
python3 -c "
import sys, re
text = sys.stdin.read()
text = re.sub(r'<p><em>(.*?)</em></p>', r'<p class=\"thought\"><em>\1</em></p>', text, flags=re.DOTALL)
text = re.sub(r'href=\"([^\"]+)\"', lambda m: 'href=\"' + m.group(1).replace('?', '%3F').replace('!', '%21') + '\"', text)
print(text, end='')
"
echo "$HTML_END"
} > "$html_final"