Wagtail Asciinema
Implements asciinema-player embedding block.
Requirements (tested)
Python 3.5+
Wagtail 1.9+
Django 1.10
Installation
Install the library with pip:
$ pip install wagtail-asciinema
Add wagtail_asciinema to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
...
'wagtail_asciinema',
]
Download asciinema-player sources from it’s release page and then place it in your STATIC directory.
Add AsciinemaBlock to your StreamField:
from wagtail_asciinema.blocks import AsciinemaBlock
asciinema = AsciinemaBlock(classname='full')
You can add a method to determine if you need to include asciinema code into your static/js blocks:
from wagtail.wagtailcore.models import Page
class ArticlePage(Page):
@property
def has_asciinema(self):
for stream_child in self.content:
if stream_child.block.name == 'asciinema':
return True
return False
And then add asciinema on your page on demand:
{% block extra_css %}
{% if self.has_asciinema %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}frontend/asciinema/v2.4.1/asciinema-player.css">
{% endif %}
{% endblock %}
{% block extra_js %}
{% if self.has_asciinema %}
<script src="{{ STATIC_URL }}frontend/asciinema/v2.4.1/asciinema-player.js"></script>
{% endif %}
{% endblock %}
Metadata
Release files for wagtail-asciinema 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wagtail-asciinema-0.0.2.tar.gz | 4.0 kB | Without provenance | Details for wagtail-asciinema-0.0.2.tar.gz |
Release files / wagtail-asciinema-0.0.2.tar.gz
| Download URL | wagtail-asciinema-0.0.2.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f16254dbe6c4308ddb80f27a5cfe5750dcb9f7ee411faf4c1b59e371d248cfe3
|
|
BLAKE2b-256 checksum How to use checksums |
ebd0965513c9e13c98b704531a730120ce4f5ae8ba0cd44b97eb748df003379d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for wagtail-asciinema 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.