Metadata-Version: 2.4
Name: collective.bbcodesnippets
Version: 2.0.0b1
Summary: BBCode Snippet Support for Plone
Project-URL: PyPI, https://pypi.python.org/pypi/collective.bbcodesnippets
Project-URL: Changelog, https://github.com/collective/collective.bbcodesnippets/blob/main/CHANGES.rst
Project-URL: Source, https://github.com/collective/collective.bbcodesnippets
Project-URL: Issues, https://github.com/collective/collective.bbcodesnippets/issues
Author-email: Jens Klein <jk@kleinundpartner.at>
License: GPL 2.0
License-File: LICENSE.rst
Keywords: bbcode,plone
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Plone
Classifier: Framework :: Plone :: 6.1
Classifier: Framework :: Plone :: Addon
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Requires-Dist: bbcode>=1.1
Requires-Dist: plone-restapi
Provides-Extra: test
Requires-Dist: pdbpp; extra == 'test'
Requires-Dist: plone-app-contenttypes[test]; extra == 'test'
Requires-Dist: pytest-plone; extra == 'test'
Description-Content-Type: text/x-rst

`collective.bbcodesnippets <http://pypi.python.org/pypi/collective.bbcodesnippets>`_ provides pervasive, generic and extensible `BBCode Markup <https://en.wikipedia.org/wiki/BBCode>`_ integration for Plone.

Functionality
=============

*collective.bbcodesnippets* replaces BBCode in the whole generated HTML output.
BBCode snippets can be placed everywhere in the site. 

At transform time at the end of the chain, before or after Diazo (configurable), the output is parsed and all BBCode will be replaced.

The BBCode parser only replaces configured BBCode snippets. 
At the control panel all registered BBCodes are listed to be activated.
By default all codes are inactive.

This package utilizes the excellent `bbcode package <https://pypi.org/project/bbcode/>`_  from Dan Watson to parse and replace.
We register all `default formatters <https://dcwatson.github.io/bbcode/tags/>`_ as named utilities which are used as factories for the formatter using the Zope Component Architecture (ZCA). 
Custom parsers can be provided by registering an own named utility.
Before parsing at transform time new Parser is created using the configured adapters only.

Further features:

- The Plone toolbar got a new menu to copy BBCode templates for the active BBCodes.
- TinyMCE got a new menu to insert BBCode templates.
- There is a demo page with all activated BBCodes at the portal root under ``@@bbcodesnippets-demo``.
- A boolean index ``has_bbcodes`` got added to the ``portal_catalog``.  
  Content with active or inactive BBCcodes in any of their text or richtext Dexterity schema fields are indexed ``True``.


Installation
------------

Install collective.bbcodesnippets by adding it to your buildout::

    [buildout]

    ...

    eggs =
        collective.bbcodesnippets


and then running ``buildout``.

Afterwards (re)start Plone, go to the controlpanel and install the addon. 

Then there is a conrol-panel to control the allowed BBcodes.


Source Code
===========

.. image:: https://github.com/collective/collective.bbcodesnippets/actions/workflows/tests.yaml/badge.svg
    :target: https://github.com/collective/collective.bbcodesnippets/actions/workflows/tests.yaml
    :alt: Build and Test

The sources are in a GIT DVCS with its main branches at `github <http://github.com/collective/collective.bbcodesnippets>`_.

We'd be happy to see many forks and pull-requests to make collective.bbcodesnippets even better.


Contributors
============

- `Jens W. Klein, Klein & Partner KG  <https://github.com/jensens>`_- Author

- `Michael Graf, FH St.Pölten <https://github.com/2silver>`_ - Idea and Use Case

Thanks to `St. Pölten University of Applied Sciences <https://www.fhstp.ac.at>`_ for initial funding.
