Compare commits

..

2 Commits

Author SHA1 Message Date
ktyl 6e592660f9 blog: transactionism 2023-08-10 00:48:19 +02:00
ktyl 2d58ddf640 build: include <ul> in text panels 2023-08-10 00:47:54 +02:00
2 changed files with 4 additions and 0 deletions

View File

@ -102,6 +102,7 @@ But if I'd taken that optimised path, I might have missed out on enjoying the th
---
I didn't reference anything directly, but there are a few books I've been thinking about which motivated this point of view. They are:
* [You Are Not A Gadget](https://www.goodreads.com/en/book/show/6683549-you-are-not-a-gadget)
* [Homo Deus](https://www.goodreads.com/book/show/31138556-homo-deus)
* [Zen and The Art of Motorcycle Maintenance](https://www.goodreads.com/book/show/19438058-zen-and-the-art-of-motorcycle-maintenance)

View File

@ -61,6 +61,9 @@ with open(dummy_file, 'r') as read_file, open(dest_file, 'w') as write_file:
# extract images from their enclosing <p> tags and put them in img panels
html = re.sub('(<p>(<img(?:.+)/>)</p>)', r'<div class="img-panel">\2</div>', html)
# wrap <ul> elements with <p> to get them into blocks
html = re.sub('(<ul>(\n|.)*</ul>)', r'<p>\1</p>', html)
# insert text-panel start between non-<p> and <p> elements
html = re.sub('((?<!</p>)\n)(<p>)', r'\1<div class="text-panel">\n\2', html)
# insert para-block end between <p> and non-<p> elements