When Wagtail Is Overkill and Markdown Is Too Generic

PUBLISHED
23 NOV 2026
FILED UNDER
  • django
  • django-spellbook
  • markdown
  • tools

When Wagtail is overkill and regular Markdown is too generic, that's where Django Spellbook fits. I built it years ago, its Rust cousin renders this site, and this week I got reminded what I built it for.

I have run Wagtail for clients, for non-tech clients, and it always takes some training. I usually send a 2 minute video on how to use the Wagtail dashboard, but clients always need more help. It's also just too much for a personal site, it's super bloated. For example, I would not put Wagtail in my production Django projects unless it was ONLY a blog, but for something that has to be a real platform and also have a blog and/or documentation, I pick Django Spellbook.

The page that started it

Storm Developments asks its customers before it changes something that affects them. Each ask is a proposal, a public page at /proposals/<slug>/ where customers and alpha testers answer yes, or no with a reason. The first one, Alpha 2, was a designed page with cards, a numbered road and a timeline, and it was written as a hand-made Django template.

Here's one piece of it, the road every change takes before it reaches a customer:

<ol class="prop-steps">
  <li class="prop-step"><span class="prop-step-n">01</span>Tested locally</li>
  <li class="prop-step"><span class="prop-step-n">02</span>Tested on staging</li>
  <li class="prop-step prop-step--here"><span class="prop-step-n">03</span>The alpha</li>
  <li class="prop-step"><span class="prop-step-n">04</span>Customer nodes</li>
</ol>

The road as it renders on the Alpha 2 proposal: four numbered steps, Tested locally, Tested on staging, The alpha and Customer nodes, with the alpha lit.

The whole page was 52 lines like that. It looked good, and changing one word in it meant editing HTML.

When I sat down to write the second proposal, I realized how unsustainable hand-crafting and hand-editing HTML templates will become. The next proposal came to 85 lines and 13 cards, each one a <div class="prop-card"> with a name and a detail written out by hand. The words and the markup were tangled together, so nobody could touch a sentence without knowing which classes make which card.

Spellbook was made for exactly this, so I stopped and built the blocks.

The same road, as Markdown

{~ steps here="3" ~}
- Tested locally
- Tested on staging
- The alpha
- Customer nodes
{~~}

The steps block rendered on the Alpha 2 proposal: four numbered steps, Tested locally, Tested on staging, The alpha and Customer nodes, with the alpha lit.

That renders the exact HTML above, class for class. The numbers are generated, so adding a step in the middle renumbers the rest. here="3" lights the third step. Anyone who can write a Markdown list can edit it, and nobody has to know what prop-step--here is.

I diffed every class on the old page against the new one, and they match. It looks no different at all.

What a block is

A Spellbook block is a Python class and a template. Here's the real one behind the steps block:

@SpellBlockRegistry.register()
class StepsBlock(BasicSpellBlock):
    name = 'steps'
    arguments = ('here', 'how')
    template = 'marketing/blocks/steps.html'

    def get_context(self) -> dict:
        here = str(self.kwargs.get('here', '')).strip()
        steps = []
        for n, item in enumerate(list_items(self.content), start=1):
            number = f'{n:02d}'
            if item.label:
                number = format_html('{} &middot; {}', number, item.label)
            steps.append({'n': number, 'text': item.text, 'here': here == str(n)})
        return {'steps': steps, 'how': str(self.kwargs.get('how', '')).lower() in _YES}

name is what you type between the tildes. arguments lists what the block accepts, like here. self.content is everything between the opening tag and the closing one, here the Markdown list. get_context turns that into whatever the template needs.

The template is one line:

<ol class="prop-steps{% if how %} prop-how{% endif %}">{% for s in steps %}<li class="prop-step{% if s.here %} prop-step--here{% endif %}"><span class="prop-step-n">{{ s.n }}</span>{{ s.text }}</li>{% endfor %}</ol>

It's one line on purpose. Spellbook runs a Markdown pass over the whole page after the blocks render, and a newline in the template's output can come back as a <br />.

Registering it is one file. Spellbook auto-discovers a spellblocks.py in every installed Django app, so putting the class in marketing/spellblocks.py makes the steps block work in every Markdown file the site renders. No settings, no URL config.

The proposal pages run on five of these, all in that one file, lede, cards and tile, steps and timeline. Spellbook already ships a card block, which is why mine is called tile. With them, the Alpha 2 page went from a 52-line template to one Markdown file, frontmatter on top and the page underneath.

Designing and building the spellblocks is where the clever work is at. It feels more like engineering than writing prose, which is what I enjoy. Once you put that effort in for a smart design, then you can re-use it everywhere.

The design restraint

Spellbook doesn't nest one block inside another. Self-closing blocks are the exception, so each tile in a grid is written self-closing:

{~ cards ~}
{~ tile tier="all" name="Admin" detail="Owns the bucket. Reads, writes, deletes and changes its settings." /~}
{~ tile tier="rw" name="Read-Write" detail="Reads, writes and deletes objects anywhere in the bucket." /~}
{~ tile tier="ro" name="Read-Only" detail="Lists and downloads objects anywhere in the bucket." /~}
{~~}

The three key levels as tiles on the Advanced Key Options proposal, with Admin in amber, Read-Write in blue and Read-Only in green.

I don't plan to fix the nesting. I'm fine with self-closing ones being allowed nested. Other than that, it would get too complicated and hard to reason about, and at that point, pick Wagtail.

Where this leads

A page built from blocks is one standalone Markdown file, so it can live anywhere, even in its own repo outside your deploy cycle. Building the block takes some clever work. Once it's built and polished, you reuse it everywhere, and every page after that is just Markdown.

Have comments? Add me on Mastodon and shoot me a message.