A Wagtail richdocument content type built with wagtail straemfield.
Project description
This is a wagtail app to be applied on wagtail generic docs. It adds the following streamfield blocks:
doc_byline
body_text
quote
bustout
code_chunk
math_formula
table
media_embed
Dependencies
Quick Start
install from pypy:
pip install wagtail-utphy-richdocument
add “utphy_richdocument” and “wagtail.contrib.table_block” to your INSTALLED_APPS setting:
INSTALLED_APPS = [ ... 'wagtail.contrib.table_block', 'utphy_richdocument', ]
In your own app create a new model which subclasses the StreamFieldDoc model.
models.py:
from utphy_richdocument.models import StreamFieldDoc class YourModel(StreamFieldDoc): template = 'path_to_your_template.html' content_panels = Page.content_panels + [ # your_model_fields StreamFieldPanel('body'), ]
In your template, make sure you have the following snippet:
path_to_your_template.py:
{% for block in self.body %} {{block}} {% endfor %}
Run python manage.py collectstatic to collect the static files from the app into your own static section.
Run python manage.py migrate to update the tables in your app.
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
Hashes for wagtail-utphy-richdocument-0.7.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa25adaf89f01c9c0755d4a314a307eff53aec5c393a965f4fa6135be6cbc4b5 |
|
MD5 | cc2d7afecc4607945278b34863b39713 |
|
BLAKE2b-256 | 0244a25cf93573216cece7a2c9cf23cbb5ab2d6f733df3d756ae6dba1909f505 |