duncan­lock­.net

I run a Miniflux instance on my desktop computer, which fetches all my feeds and makes the content available locally.

Inspired by a discussion the other day on HackerNews, I wrote a little script that asks Miniflux for a list of my feeds in OPML format and turns it into an AsciiDoc page, which I publish on here, as my BlogRoll & Links page:

import os
import sys
import urllib.request
import xml.etree.ElementTree as ET
from datetime import datetime

key = os.environ["MINIFLUX_API_KEY"]

if not key:
    print("$MINIFLUX_API_KEY not set.")
    sys.exit(-1)

url = "http://miniflux.home/v1/export"
hdr = {"X-Auth-Token": key}
request = urllib.request.Request(url, headers=hdr)
opml = ET.fromstring(urllib.request.urlopen(request).read())
updated = datetime.now().astimezone().replace(microsecond=0).isoformat(" ")

header = f"""
:title: Blogroll & Links
:slug: blogroll-links
:created: 2022-11-15 13 …
Continue reading “Automatically Publishing a Blogroll from an OPML File”

Asciidoc
Figure 1. Asciidoc.

I’ve been using reStructuredText for writing on this blog, because it has lots of built-in features that markdown doesn’t.

However, reStructuredText’s actual syntax is a bit…​ fiddly - particularly its non-atx headings, too many things relying on lining up white space, etc…​ If I don’t use it for a bit, I have to look up or copy & paste all the advanced syntax.

I’d prefer to use AsciiDoc, as it has all the extra features, and if you use Asciidoctor, all the simple stuff is the same as markdown - which isn’t (currently) standard AsciiDoc, but is a nice simplification.

The subset of features from reStructuredText (or Asciidoc) that Markdown doesn’t have – and that I’m actually using on this blog, are:

  • Figure/Images with captions
  • Admonitions
  • Front-matter/Metadata
  • Footnotes
Continue reading “Using AsciiDoc & Asciidoctor for blogging”