HTML XBlock
A new HTML XBlock that is designed with security and embedding in mind.
Introduction
This XBlock provides a newer alternative to the existing HTML XModule in edX platform as it presents a number of problems when trying to embed it in another site (in particular, it often hosts content that depends on JS globals like jQuery being present, and it allows users to include arbitrary JavaScript).
Installation
You may install XBlock-html using its setup.py, or if you prefer to use pip, run:
pip install https://github.com/open-craft/xblock-html
You may specify the -e flag if you intend to develop on the repo.
To enable this block, add "html5" and "excluded_html5" to the course's advanced module list. The options Text and Exclusion will appear in the advanced components.
Configuration
The tables added to the content in the WYSIWYG editor can be styled according the theming requirements of the deployment by adding custom CSS classes to them.
Add the following to your XBLOCK_SETTINGS part of the CMS/Studio confguration:
XBLOCK_SETTINGS = {
"html5": {
"table_custom_classes": ["your-list", "of-css", "classes"]
}
}
These classes will be available in the "General" tab of "Table Properties" dialog, under "Classes".
Development
If you're willing to develop on this repo, you need to be familiar with different technologies and the repos' dependencies. However, to make things easier to setup and to manage, there're bunch of make commands that you can use to do things faster.
Setting the requirements up
Hitting the following command will install in your python environment all the requirements you need for this project:
$ make requirements
Running tests
Tests are essential for this project to keep all its features working as expected. To check your changes you can use:
$ make test
Or if you want to check the code quality only, hit:
$ make quality
Release files for html-xblock 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| html_xblock-2.0.0.tar.gz | 42.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| html_xblock-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:85.5 kB
Release files / html_xblock-2.0.0.tar.gz
| Download URL | html_xblock-2.0.0.tar.gz |
|---|---|
| Size | 42.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b129f34e63ad08cf43500eee2aadbc395bd8fdb8f94541208861111524ae17b5
|
|
BLAKE2b-256 checksum How to use checksums |
886593d5c6c9bd88453f311d90eeb19853196eeefd3bc876289919922ee370fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / html_xblock-2.0.0-py3-none-any.whl
| Download URL | html_xblock-2.0.0-py3-none-any.whl |
|---|---|
| Size | 43.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28e1e4497999fea79f533e4f0783509864948326e20adc3d32fa49cdf2ded02f
|
|
BLAKE2b-256 checksum How to use checksums |
f3af47b90c7bf728187b7e67fb4e9f68ba75c88d8b55a096e5e6930239e61a35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|