about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--_layout/hair.html3
-rw-r--r--_layout/page_foot.html5
-rwxr-xr-x_libs/formbox/format23
-rw-r--r--_rss/comments.xml4
-rw-r--r--_rss/head.xml4
-rw-r--r--blog/butter.md1
-rw-r--r--utils.jl2
7 files changed, 25 insertions, 17 deletions
diff --git a/_layout/hair.html b/_layout/hair.html
index 7c7ee2d..ffebb85 100644
--- a/_layout/hair.html
+++ b/_layout/hair.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html lang=en>
-<meta charset=UTF-8 name=viewport content='width=device-width, initial-scale=1'>
+<meta charset=utf-8>
+<meta name=viewport content='width=device-width, initial-scale=1'>
 <link rel='alternate' type='application/rss+xml' title='{{website_title}}'
       href='/{{ispage /tag/*}}tag/{{fd_tag}}/{{end}}{{rss_file}}.xml'>
 <link rel='icon' href='/assets/favicon.png'>
diff --git a/_layout/page_foot.html b/_layout/page_foot.html
index 88d33ea..f6745c4 100644
--- a/_layout/page_foot.html
+++ b/_layout/page_foot.html
@@ -6,6 +6,7 @@
 
 {{isnotempty rss}}<h2>Comments</h2>
 {{comments_rendered}}
-<p>To reply, follow the <code>mailto</code> link
-  in the the author's name.</p>{{end}}
+<p>Follow the anchor in an author's name to reply via
+  <a href=https://useplaintext.email>plaintext email</a>.  Markdown
+  inline markups, block quotes and code blocks are supported.</p>{{end}}
 {{insert footer.html}}
diff --git a/_libs/formbox/format b/_libs/formbox/format
index 39e6132..bad40db 100755
--- a/_libs/formbox/format
+++ b/_libs/formbox/format
@@ -22,7 +22,7 @@ from functools import partial
 from itertools import starmap
 from mailbox import mbox
 from pathlib import Path
-from urllib.parse import quote
+from urllib.parse import quote, unquote
 
 from bleach import clean, linkify
 from markdown import markdown
@@ -34,6 +34,7 @@ sanitise = partial(clean, tags=('a', 'code', 'em', 'strong', 'sub', 'sup',
 
 
 def extract(archive, parent):
+    """Recursively extract emails in reply to given message ID."""
     for message_id, message in archive.copy().items():
         # TODO: handle multipart
         if message['In-Reply-To'] != parent: continue
@@ -42,12 +43,14 @@ def extract(archive, parent):
 
 
 def decode(header):
+    """Return the decoded email header."""
     for string, charset in decode_header(header):
         encoding = 'utf-8' if charset is None else charset
         yield string.decode(encoding)
 
 
 def render(template, forest, parent):
+    """Render the thread recursively based on given template."""
     for self, children in forest:
         message_id = self['Message-Id']
         date = parsedate_to_datetime(self['Date']).date().isoformat()
@@ -60,12 +63,14 @@ def render(template, forest, parent):
                               children='\n'.join(rendered_children))
 
 
-parser = ArgumentParser()
-parser.add_argument('mbox')
-parser.add_argument('id')
-parser.add_argument('template', type=Path)
-args = parser.parse_args()
+if __name__ == '__main__':
+    parser = ArgumentParser()
+    parser.add_argument('mbox')
+    parser.add_argument('id', type=unquote)
+    parser.add_argument('template', type=Path)
+    args = parser.parse_args()
 
-archive = {m['Message-Id']: m for m in mbox(args.mbox)}
-template = args.template.read_text()
-print(*render(template, extract(archive, args.id), args.id), sep='', end='')
+    archive = {m['Message-Id']: m for m in mbox(args.mbox)}
+    template = args.template.read_text()
+    print(*render(template, extract(archive, args.id), args.id),
+          sep='', end='')
diff --git a/_rss/comments.xml b/_rss/comments.xml
index 13d514b..8ebcccd 100644
--- a/_rss/comments.xml
+++ b/_rss/comments.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <rss version="2.0"
      xmlns:atom="http://www.w3.org/2005/Atom"
-     xmlns:content="http://purl.org/rss/1.0/modules/content"
-     xmlns:dc="http://purl.org/dc/elements/1.1">
+     xmlns:content="http://purl.org/rss/1.0/modules/content/"
+     xmlns:dc="http://purl.org/dc/elements/1.1/">
 <channel>
 <title>Re: {{fd2rss rss_title}}</title>
 <link>{{fd_full_url}}</link>
diff --git a/_rss/head.xml b/_rss/head.xml
index e27fe5e..814236d 100644
--- a/_rss/head.xml
+++ b/_rss/head.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <rss version="2.0"
      xmlns:atom="http://www.w3.org/2005/Atom"
-     xmlns:content="http://purl.org/rss/1.0/modules/content"
-     xmlns:wfw="http://wellformedweb.org/CommentAPI">
+     xmlns:content="http://purl.org/rss/1.0/modules/content/"
+     xmlns:wfw="http://wellformedweb.org/CommentAPI/">
 <channel>
 <title>{{website_title}}</title>
 <link>{{website_url}}</link>
diff --git a/blog/butter.md b/blog/butter.md
index b469251..ec1af10 100644
--- a/blog/butter.md
+++ b/blog/butter.md
@@ -69,6 +69,7 @@ to match memory[^memory] and the rest as a single chonky Btrfs partition:
 parted /dev/nvme0n1 -- mklabel gpt
 parted /dev/nvme0n1 -- mkpart ESP fat32 1MiB 1GiB
 parted /dev/nvme0n1 -- set 1 boot on
+mkfs.vfat /dev/nvme0n1p1
 
 parted /dev/nvme0n1 -- mkpart Swap linux-swap 1GiB 9GiB
 mkswap -L Swap /dev/nvme0n1p2
diff --git a/utils.jl b/utils.jl
index 81c56fa..62dce1d 100644
--- a/utils.jl
+++ b/utils.jl
@@ -11,7 +11,7 @@ function hfun_abslink(args)
 end
 
 dir_url() = strip(dirname(locvar(:fd_url)), '/')
-message_id() = "<$(dir_url())@cnx>"
+message_id() = "%3C$(dir_url())@cnx%3E"
 hfun_comments() = @sprintf("https://lists.sr.ht/~cnx/site?search=%s:%s",
                            "In-Reply-To", message_id())