{"id":15045100,"url":"https://github.com/helios-ag/fmbbcodebundle","last_synced_at":"2025-04-06T09:08:18.492Z","repository":{"id":1790105,"uuid":"2714013","full_name":"helios-ag/FMBbCodeBundle","owner":"helios-ag","description":":capital_abcd: BBCode bundle for Symfony projects","archived":false,"fork":false,"pushed_at":"2024-01-21T04:15:08.000Z","size":278,"stargazers_count":57,"open_issues_count":15,"forks_count":33,"subscribers_count":8,"default_branch":"3.0","last_synced_at":"2025-04-06T09:08:13.462Z","etag":null,"topics":["bbcode","bbcode-filter","bundle","decoda","php","symfony","symfony-bundle","twig","twig-extension"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"joppi/2048-3D","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/helios-ag.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-11-05T05:20:42.000Z","updated_at":"2024-10-13T18:56:15.000Z","dependencies_parsed_at":"2024-06-18T22:42:53.174Z","dependency_job_id":"1b1499a3-5596-495f-b63d-669aaad28e60","html_url":"https://github.com/helios-ag/FMBbCodeBundle","commit_stats":{"total_commits":195,"total_committers":19,"mean_commits":"10.263157894736842","dds":"0.49230769230769234","last_synced_commit":"a710426d58b950e2b681f34c712064be0d5fc97d"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helios-ag%2FFMBbCodeBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helios-ag%2FFMBbCodeBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helios-ag%2FFMBbCodeBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helios-ag%2FFMBbCodeBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/helios-ag","download_url":"https://codeload.github.com/helios-ag/FMBbCodeBundle/tar.gz/refs/heads/3.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247457802,"owners_count":20941906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bbcode","bbcode-filter","bundle","decoda","php","symfony","symfony-bundle","twig","twig-extension"],"created_at":"2024-09-24T20:51:27.454Z","updated_at":"2025-04-06T09:08:18.472Z","avatar_url":"https://github.com/helios-ag.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"FMBBCodeBundle\n==============\n\n[PHP-Decoda](https://github.com/milesj/decoda) integration in Symfony2\n\nA lightweight lexical string parser for BBCode styled markup.\n\n## Contributors\n\n* **Alexandre Quercia [alquerci](https://github.com/alquerci)**\n* Gaiffe Antoine [toinouu](https://github.com/toinouu)\n* Luis Íñiguez [idetia](https://github.com/idetia)\n* Sebastian [slider](https://github.com/slider)\n* [olleyyy](https://github.com/olleyyy)\n* Dirk Olbertz [dolbertz](https://github.com/dolbertz)\n* Florian Krauthan [fkrauthan](https://github.com/fkrauthan)\n* [predakanga](https://github.com/predakanga)\n* Dan [piratadelfuturo](https://github.com/piratadelfuturo)\n\n\n### Code Quality Assurance ###\n\n| SLInsight | Travis CI |  Gitter | Coverage | StyleCI |\n| ----------|-----------|---------|----------|---------|\n|[![SensioLabsInsight](https://insight.sensiolabs.com/projects/f355c58b-f9b6-482c-8d2d-d1bc8791c9e5/big.png)](https://insight.sensiolabs.com/projects/f355c58b-f9b6-482c-8d2d-d1bc8791c9e5) |[![Build Status](https://travis-ci.org/helios-ag/FMBbCodeBundle.png?branch=master)](https://travis-ci.org/helios-ag/FMBbCodeBundle)|[![Join the chat at https://gitter.im/helios-ag/FMBbCodeBundle](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/helios-ag/FMBbCodeBundle?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)|[![Coverage Status](https://coveralls.io/repos/helios-ag/FMBbCodeBundle/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/helios-ag/FMBbCodeBundle?branch=master)|[![StyleCI](https://styleci.io/repos/2714013/shield)](https://styleci.io/repos/2714013)|\n\n\n| Deps Status | Version |  Downloads |\n| ----------|-----------|---------|\n|[![Dependency Status](https://www.versioneye.com/user/projects/53db56c04b3ac87d6a000207/badge.svg?style=flat)](https://www.versioneye.com/user/projects/53db56c04b3ac87d6a000207)|[![Latest Stable Version](https://poser.pugx.org/helios-ag/fm-bbcode-bundle/version.png)](https://packagist.org/packages/helios-ag/fm-bbcode-bundle)|[![Total Downloads](https://poser.pugx.org/helios-ag/fm-bbcode-bundle/d/total.png)](https://packagist.org/packages/helios-ag/fm-bbcode-bundle)|\n\n## Installation\n\nTo install this bundle, you'll need both the [Decoda library](https://github.com/milesj/decoda)\nand this bundle. Installation depends on how your project is setup:\n\n### Step 1: Installation\n\nUsing Composer, just add the following configuration to your `composer.json`:\n\nOr you can use composer to install this bundle:\n\nFor symfony \u003c3.0, use latest ~6 version\n\n```sh\ncomposer require helios-ag/fm-bbcode-bundle:~6\n```\n\nfor Symfony 3\n\n```sh\ncomposer require helios-ag/fm-bbcode-bundle\n```\nor\n\n```sh\ncomposer require helios-ag/fm-bbcode-bundle:~7\n```\n\n### Step 2: Enable the bundle\n\nFinally, enable the bundle in the kernel:\n\n``` php\n\u003c?php\n// app/AppKernel.php\n\npublic function registerBundles()\n{\n    $bundles = array(\n        // ...\n        new FM\\BbcodeBundle\\FMBbcodeBundle(),\n    );\n}\n```\n### Step 3: Dump emoticons (optional)\n\nTo enable emoticons via emoticon hook, use the following command to copy emoticons images to\npublic folder (web/emoticons)\n\n``` bash\n    ./app/console bbcode:dump\n```\n\n## Basic configuration\n\n### Make the Twig extensions available by updating your configuration:\n\n    By default only \"default\" filter enabled, which provide support\n    for [b], [i], [u], [s], [sub], [sup], [abbr], [br], [hr], [time]\n    BBCodes\n\n### Examples to use the extension in your Twig template\n\nDefine BBCode filter in your config.yml:\n\n``` yaml\n    fm_bbcode:\n      filter_sets:\n        my_default_filter:\n          strict: false # if you want to parse attr values without quotes\n          locale: ru\n          xhtml: true\n          filters: [ default ]\n```\n\nAnd you can do the following:\n\n``` jinja\n     {{'[b]Bold text[/b]'|bbcode_filter('my_default_filter')}}\n     {{'[u]Underlined text[/u]'|bbcode_filter('my_default_filter')}}\n     {{'[i]Italic text[/i]'|bbcode_filter('my_default_filter')}}\n```\n\n``` yaml\n    fm_bbcode:\n      filter_sets:\n        my_default_filter:\n          locale: ru\n          xhtml: true\n          filters: [ default, quote ]\n          whitelist: [ b, quote ]\n```\n\nAfter enabling \"quote\" filter, you can do such things:\n\n``` jinja\n      {{'[quote=\"helios\"]My quote[/quote]'|bbcode_filter('my_default_filter')}}\n```\n\nAlso you can define multiple filter sets under filter_sets parameter like this:\n\n``` yaml\n    fm_bbcode:\n      filter_sets:\n        my_forum_filter:\n          locale: ru\n          xhtml: true\n          filters: [ default, quote ]\n          whitelist: [ b, quote ]\n        my_comment_filter:\n          locale: ru\n          xhtml: true\n          filters: [ default, block, code, email, image, list, quote, text, url, video ]\n```\n\n``` jinja\n      {{'[quote=\"helios\"]My quote[/quote]'|bbcode_filter('my_forum_filter')}}\n      {{'[code]My source code[/code]'|bbcode_filter('my_comment_filter')}}\n```\n\nPlease keep in mind, that whitelist tags suppress tags, that applied by filters configuration.\n\n\n### Strip filter\nTo clear text from any bbcodes use bbcode_clean filter:\nexample:\n``` jinja\n{{'[b]some text[/b]'|bbcode_clean}}\n```\nThis filter will eliminate any known to decoda tags\n\n### Escaping and line breaks\n\nEscaping and line breaks can be controlled via \"escaping\" and \"line_breaks\" parameters under filter configuration.\nDefault configuration for them is 'true'. If you wish to pipeline filters, set escaping to false.\n\n## Advanced configuration\n\n### Overriding messages\n\nSome templates and hooks, use text strings, that can be translated into different languages, the original file\nlocated under decoda/config directory, but content of this file can be overriden with messages option, under\nmessages: node. File should be json formatted.\n\n```yaml\nfm_bbcode:\n    config:\n      messages: @SomeBundle/Resources/config/messages.json\n```\n\n### Adding own templates\n\nYour own templates can be defined at templates node, the example below shows how:\n```yaml\n    fm_bbcode:\n        config:\n          templates:\n            - path: @SomeBundle/Resources/views/templates\n```\nTemplate examples can be found inside decoda library\n\n\n### Adding own filter\n\nTo enable a custom filter, add it as a regular service in one of your configuration, and tag it with `fm_bbcode.decoda.filter`:\n\n```yaml\nservices:\n  acme_demo.decoda.filter.your_filter_name:\n    class: Fully\\Qualified\\Filter\\Class\\Name\n    tags:\n      - { name: fm_bbcode.decoda.filter, id: your_filter_name }\n```\n\nYour service must implement the `Decoda\\Filter` interface.\n\nIf your service is created by a factory, you **MUST** correctly set the class parameter for this tag to work correctly.\n\n\n### Adding own hook\n\nTo enable a custom hook, add it as a regular service in one of your configuration, and tag it with `fm_bbcode.decoda.hook`:\n\n```yaml\nservices:\n  acme_demo.decoda.hook.your_hook_name:\n    class: Fully\\Qualified\\Hook\\Class\\Name\n    tags:\n      - { name: fm_bbcode.decoda.hook, id: your_hook_name }\n```\n\nYour service must implement the `Decoda\\Hook` interface.\n\nIf your service is created by a factory, you **MUST** correctly set the class parameter for this tag to work correctly.\n\nThen enable it in your configuration:\n\n``` yaml\n    fm_bbcode:\n      filter_sets:\n        my_default_filter:\n          filters: [ default ]\n          hooks: [ your_hook_name ]\n```\n\n\n### Customize your own emoticons\n\nYour own emoticons can be defined at `emoticon` node, the example below shows how:\n\n```yaml\nfm_bbcode:\n  emoticon:\n    resource: path/to/emoticons.yml\n```\n\n```yaml\n# path/to/emoticons.yml\nimports:\n  - { resource: path/to/another/emoticons.yml }\n\nemoticons:\n  my_emoticon:\n    url:   # Default: %fm_bbcode.emoticon.path%/my_emoticon.png\n    html:  # Default: \u003cimg src=\"%fm_bbcode.emoticon.path%/my_emoticon.png\" alt=\"\" \u003e\n    xHtml: # Default: \u003cimg src=\"%fm_bbcode.emoticon.path%/my_emoticon.png\" alt=\"\" /\u003e\n    smilies:\n      - \":my_emoticon:\"\n```\n\n### How to automatically dump emoticons on each deploy\n\nAdd the following commands to you projects composer.json:\n\n```json\n# composer.json\n    \"scripts\": {\n        \"post-install-cmd\": [\n            \"FM\\\\BbcodeBundle\\\\Composer\\\\ScriptHandler::installEmoticons\"\n        ],\n        \"post-update-cmd\": [\n            \"FM\\\\BbcodeBundle\\\\Composer\\\\ScriptHandler::installEmoticons\"\n        ]\n    }\n```\n\nTo customize emoticons assets folders, use `path` and `folder` node configuration:\n\n```yaml\n# app/config.yml\n\nfm_bbcode:\n  emoticon:\n    path:   # Default: /emoticons\n    folder: # Default: %kernel.root_dir%/../vendor/mjohnson/decoda/emoticons%\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelios-ag%2Ffmbbcodebundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelios-ag%2Ffmbbcodebundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelios-ag%2Ffmbbcodebundle/lists"}