Documentation Utilities (Docutils, reStructuredText) for django.
Project description
django-docutils, docutils (reStructuredText) support for Django
Documentation
The full documentation is at https://django-docutils.git-pull.com.
Quickstart
Install django-docutils:
pip install django-docutils
Template filter
If you want to use the template filter, add it to your INSTALLED_APPS in your settings file:
INSTALLED_APPS = [ # ... your default apps,
'django_docutils'
]
Then in your template:
{% load django_docutils %}
{% filter restructuredtext %}
# hey
# how's it going
A. hows
B. it
C. going
D. today
**hi**
*hi*
{% endfilter %}
Template engine (class-based view)
You can also use a class-based view to render restructuredtext.
If you want to use reStructuredText as a django template engine, INSTALLED_APPS isn’t required, instead you add this to your TEMPLATES variable in your settings:
TEMPLATES = [ # .. your default engines
{
'NAME': 'docutils',
'BACKEND': 'django_docutils.engines.Docutils',
'DIRS': [],
'APP_DIRS': True,
}]
Now django will be able to scan for .rst files and process them. In your view:
from django_docutils.views import DocutilsView
class HomeView(DocutilsView):
template_name = 'base.html'
rst_name = 'home.rst'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-docutils-0.4.0.tar.gz
.
File metadata
- Download URL: django-docutils-0.4.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c704830ed49b09d169a4d6c179b7b0674c63752973bc6f4355a049e9b7b586d9 |
|
MD5 | f6f4aed3cece4653bbb9b693fd8d163c |
|
BLAKE2b-256 | 5444e44bcba852ef6b4f8fe9b68954031bf17a1d2b590038cbe6edde9fa71e5a |