Welcome To the Examples of Django Spellbook!
Django Spellbook is a powerful toolkit for creating and managing markdown-based content in your Django projects. It's designed to be simple, flexible, and easy to use, with a focus on maintainability and extensibility.
This examples serves as a collection of real-world examples showcasing the capabilities of Django Spellbook. It's a great resource for learning how to use Django Spellbook and exploring its features.
Basic Markdown
- Install the package
- Add to
INSTALLED_APPS
- Start writing magical markdown!
What Are SpellBlocks?
SpellBlocks are reusable content components that you can embed directly in your markdown files. They work like Django template tags but are designed specifically for enhancing your documentation. With SpellBlocks, you can:
- Create visually distinct sections for different types of content
- Maintain consistent styling throughout your documentation
- Add interactive elements without writing HTML
- Organize complex information in a user-friendly way
Basic SpellBlock Syntax
All SpellBlocks follow a consistent syntax:
{~ block_name parameter="value" another_parameter="value" ~}
Your content goes here.
This content can include **markdown** formatting.
{~~}
Available SpellBlocks
Django Spellbook comes with several built-in SpellBlocks to immediately enhance your documentation:
Alert Block
Create attention-grabbing message boxes with different severity levels.
{~ alert type="warning" ~}
Be careful with this setting in production!
{~~}
Be careful with this setting in production!
Card Block
Organize content in visexamples/introduction/ually distinct containers with optional headers and footers.
{~ card title="Installation" footer="Updated June 2023" ~}
Install Django Spellbook using pip:
`pip install django-spellbook`
{~~}
Installation
Install Django Spellbook using pip:
pip install django-spellbook
Quote Block
Add stylized quotations with attribution.
{~ quote author="Django's Documentation" source="Design Philosophies" ~}
Explicit is better than implicit.
{~~}
Explicit is better than implicit.
Practice Block
Create structured practice exercises with metadata.
{~ practice difficulty="Beginner" timeframe="10 minutes" impact="Medium" focus="Django Templates" ~}
### Your First Template
Create a simple Django template that displays a greeting message.
{~~}
Your First Template
Create a simple Django template that displays a greeting message.
Accordion Block
Create collapsible content sections for FAQs, step-by-step guides, and more.
{~ accordion title="What is Django Spellbook?" ~}
A powerful markdown processor that extends Django's templating capabilities.
{~~}
Why Use SpellBlocks?
SpellBlocks offer several advantages over plain markdown:
Consistency
Ensure visual and structural consistency across your entire documentation.
Readability
Improve the readability of both your source markdown and the rendered output.
Maintainability
Update the appearance of all instances by changing the SpellBlock template.
Extensibility
Create custom SpellBlocks for your project's specific documentation needs.