Addon for Plone 6 - Plone Outputfilter to transform TinyMCE Markup to Bootstrap5 Accordion
Project description
README
[!IMPORTANT]
This addon works only with Plone 6.1 and higherFor Plone 6.0 use plone.staticresources >= 2.2.x
Who need this addon?
This addon provide a transform for HTML Markup. TinyMCE Plugin "accordion" insert the following Markup
<details class="mce-accordion" open="open">
<summary>Accordion Summary 1</summary>
<p>Text in the collapsible 1</p>
</details>
<details class="mce-accordion" open="open">
<summary>Accordion Summary 2</summary>
<p>Text in the collapsible 2</p>
</details>
it will be transformed to Bootstrap5 Accordion Markup
<div class="accordion" id="acc-bs0">
<div class="accordion-item">
<h2 class="accordion-header" id="heading-0-0">
<button aria-controls="collapse-0-0" aria-expanded="true" class="accordion-button" data-bs-target="#collapse-0-0" data-bs-toggle="collapse" type="button">
Accordion Summary 1
</button>
</h2>
<div aria-labelledby="heading-0-0" class="accordion-collapse collapse show" data-bs-parent="#acc-bs0" id="collapse-0-0">
<div class="accordion-body">
<p>Text in the collapsible 1</p>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="heading-0-1">
<button aria-controls="collapse-0-1" aria-expanded="true" class="accordion-button" data-bs-target="#collapse-0-1" data-bs-toggle="collapse" type="button">
Accordion Summary 2
</button>
</h2>
<div aria-labelledby="heading-0-1" class="accordion-collapse collapse show" data-bs-parent="#acc-bs0" id="collapse-0-1">
<div class="accordion-body">
<p>Text in the collapsible 2</p>
</div>
</div>
</div>
</div>
Registry Settings
Some values in registry records are set:
"plone.plugins"
- accordion
plone.valid_tags
- summary
- details
- button
plone.custom_attributes
- open
- type
- data-bs-toggle
- data-bs-target
- aria-expanded
- aria-controls
- aria-labelledby
- data-bs-parent
Enable the accordion toolbar button in the Menu
JSON Structure in the TinyMCE Controlpanel. Per default this addon enable the accordion option in the insert
menu section.
Menu
{
"insert": {
"title": "Insert",
"items": "link media | template hr | accordion"
},
}
Please check the TinyMCE controlpanel that the values are set correct.
Install Addon via buildout
add collective.outputfilters.tinymceaccordion
to your egg section in buildout.cfg
Install Addon via pip
pip install collective.outputfilters.tinymceaccordion
[!IMPORTANT]
The package is currently not on pypi please checkout the git repro
Install a Testenvironment
Create a configfile instance.yaml
for cookiecutter
default_context:
initial_user_name: "admin"
initial_user_password: "admin"
wsgi_listen: "localhost:8080"
db_storage: direct
debug_mode: true
verbose_security: true
create a plone instance via pip
install cookiecutter, if needed
python3 -m venv ./venv
source venv/bin/activate
pip install mxdev
pip install -r requirements-mxdev.txt
pip install cookiecutter
cookiecutter -f --no-input --config-file instance.yaml https://github.com/plone/cookiecutter-zope-instance
deactivate
Start the instance
source venv/bin/activate
runwsgi -v instance/etc/zope.ini
deactivate
Instance Shutdown via ctrl+c
Format and Linting
use tox
tox -e init
tox -e format
tox -e lint
Testing
use tox
tox -e init
tox -e test
debugging a single test, run the a specific test
zope-testrunner -pvc --test-path=./src -t FilterFunctionalTest
Contributors
- 1letter
Changelog
1.0a6 (2024-04-28)
Internal:
- Update README @1letter
1.0a5 (2024-04-28)
Internal:
- Update README @1letter
1.0a4 (2024-04-28)
Internal:
- remove unused files @1letter
1.0a3 (2024-04-28)
Internal:
- Update configuration files @plone
1.0a3 (unreleased)
- Nothing changed yet.
1.0a2 (2024-04-19)
- Initial release. @1letter
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
Built Distribution
Hashes for collective.outputfilters.tinymceaccordion-1.0a6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd31dcb7e6e6b8b302557b95f0ec622dbdb63c99755417fd1e81a8415e4ff914 |
|
MD5 | 063716d18b03e0190868949f834efd29 |
|
BLAKE2b-256 | 00d1fdc3dfb0101a3853e2edc8e710bd8c7f0d9e4dd6d6bf613897a47b40e80f |
Hashes for collective.outputfilters.tinymceaccordion-1.0a6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e10ea6db6ff536181784476d21c87471c41ef0c3cde40f692a1f7bb679590e2 |
|
MD5 | c18b9dccd223bd95717f5dbe5cfb4741 |
|
BLAKE2b-256 | 08590e6a3176b1501b970345294d4ced6544785c9ad61e24a8cf9ecda47e17b2 |