Django-Spellbook

Version 0.1.10

Released: April 12, 2025

ℹ️

This release introduces powerful new SpellBlocks and multi-source configuration support, making Django Spellbook even more versatile for creating and organizing markdown content.

New Features

Two New SpellBlocks

1. QuoteBlock - Create beautifully styled quotes with attribution

{~ quote author="Django Spellbook" source="Documentation" ~}
Powerful Django markdown processing with template-like features.
{~~}

Powerful Django markdown processing with template-like features.

Django Spellbook , Documentation

Also Supports Images! Add an optional 'image' parameter with a link!

{~ quote author="Albert Einstein" source="Theory of Relativity" image="https://upload.wikimedia.org/wikipedia/commons/d/d3/Albert_Einstein_Head.jpg" ~}
The speed of light is the ultimate limit of human understanding.
{~~}
Albert Einstein

The speed of light is the ultimate limit of human understanding.

Albert Einstein , Theory of Relativity

2. PracticeBlock - Structure exercises and challenges with metadata

{~ practice difficulty="Intermediate" timeframe="20 minutes" impact="High" focus="Django Templates" ~}
### Create a custom template tag
Write a template tag that formats dates according to user preferences.
{~~}

Create a custom template tag

Write a template tag that formats dates according to user preferences.

Multi-Source Configuration

Now you can process markdown from multiple directories to different Django apps, with each having its own independent templates, views, and URLs:

# settings.py
SPELLBOOK_MD_PATH = [
    BASE_DIR / "docs_content",
    BASE_DIR / "blog_content"
]
SPELLBOOK_MD_APP = [
    "docs_app",
    "blog_app"
]

With this configuration:

  • Content from docs_content will be processed to docs_app
  • Content from blog_content will be processed to blog_app
  • Access content at /content/docs_app/page-name/ and /content/blog_app/post-name/
# urls.py
urlpatterns = [
    path('content/', include('django_spellbook.urls')),
]

Coming Soon

  • Alternate Named prefixes for urls on multiple sources
  • Alternate Base Templates for each source
  • More SpellBlocks
  • More configuration options