{"id":23059915,"url":"https://github.com/aymdev/commonmarkbundle","last_synced_at":"2025-08-15T08:31:25.251Z","repository":{"id":45616523,"uuid":"302647344","full_name":"AymDev/CommonMarkBundle","owner":"AymDev","description":"A Symfony 4+ bundle to easily configure league/commonmark","archived":false,"fork":false,"pushed_at":"2021-12-04T18:28:14.000Z","size":69,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-15T22:32:25.286Z","etag":null,"topics":["commonmark","markdown","php","symfony","symfony-bundle","symfony4","symfony5"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AymDev.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}},"created_at":"2020-10-09T13:20:50.000Z","updated_at":"2024-08-04T11:16:44.000Z","dependencies_parsed_at":"2022-08-25T20:11:00.991Z","dependency_job_id":null,"html_url":"https://github.com/AymDev/CommonMarkBundle","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AymDev%2FCommonMarkBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AymDev%2FCommonMarkBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AymDev%2FCommonMarkBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AymDev%2FCommonMarkBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AymDev","download_url":"https://codeload.github.com/AymDev/CommonMarkBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229901666,"owners_count":18141740,"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":["commonmark","markdown","php","symfony","symfony-bundle","symfony4","symfony5"],"created_at":"2024-12-16T03:10:50.057Z","updated_at":"2024-12-16T03:10:50.936Z","avatar_url":"https://github.com/AymDev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CommonMarkBundle\nA **Symfony 4 / 5 / 6** bundle to easily configure [league/commonmark](https://github.com/thephpleague/commonmark) **v2**, \nallowing you to set multiple **MarkDown** converters.\n\n![Unit Test Suite](https://github.com/AymDev/CommonMarkBundle/workflows/Unit%20Test%20Suite/badge.svg)\n![Coding Standards](https://github.com/AymDev/CommonMarkBundle/workflows/Coding%20Standards/badge.svg)\n![Bundle installation](https://github.com/AymDev/CommonMarkBundle/workflows/Bundle%20installation/badge.svg)\n[![Latest Stable Version](https://poser.pugx.org/aymdev/commonmark-bundle/v)](//packagist.org/packages/aymdev/commonmark-bundle)\n[![License](https://poser.pugx.org/aymdev/commonmark-bundle/license)](//packagist.org/packages/aymdev/commonmark-bundle)\n\n - [Installation](#installation)\n - [Configuration](#configuration)\n     - [Converter type](#converter-type)\n     - [Converter options](#converter-options)\n     - [Converter extensions](#converter-extensions)\n - [Using the converters](#using-the-converters)\n     - [As services](#as-services)\n     - [In your templates](#in-your-templates)\n\n## Installation\nSimply install it with **Composer**, an auto-generated recipe will enable the bundle for you:\n```sh\ncomposer require aymdev/commonmark-bundle\n```\n\n## Configuration\nNo converter is created by default. \nCreate a **YAML** configuration file at path `config/packages/aymdev_commonmark.yaml`. \nHere is an example configuration declaring 2 converters:\n```yaml\naymdev_commonmark:\n    converters:\n        # add any converter here\n        my_converter:\n            type: 'github'\n            options:\n                enable_strong: true\n                use_underscore: false\n        \n        blog_post_converter:\n            type: 'commonmark'\n            extensions:\n                - League\\CommonMark\\Extension\\HeadingPermalink\\HeadingPermalinkExtension\n```\n\n\u003eNote that all keys inside a converter are optional.\n\n### Converter type\n\nThe `type` key can be used to choose between a *CommonMark* or a *GitHub* converter:\n\n - `commonmark` (default): `MarkdownConverter` with `CommonMarkCoreExtension`\n - `github`: `MarkdownConverter` with `GithubFlavoredMarkdownExtension`\n - `empty`: an empty `MarkdownConverter` (e.g. to use `InlinesOnlyExtension`)\n\n### Converter options\n\nThe `options` key holds the configuration passed to the converter, as an array.\n\u003eFor more information, see the [CommonMark documentation about Configuration](https://commonmark.thephpleague.com/2.0/configuration/).\n\n### Converter extensions\n\nThe `extensions` key allows to add any extension class to a converter.\n\u003eCheck the complete list of extensions on the [CommonMark documentation](https://commonmark.thephpleague.com/2.0/extensions/overview/).\n\n## Using the converters\n\n### As services\nThe bundle registers your converters as **services** with the converter name as the **service ID**.\n\nIt also creates an alias, so you can get them by *autowiring* using the *converter name* as the *argument name*,\ntype with the `League\\CommonMark\\MarkdownConverter` class.\n\n**Example YAML configuration**:\n```yaml\naymdev_commonmark:\n    converters:\n        # You can add an argument for this converter as:\n        #   MarkdownConverter $myConverter\n        my_converter:\n```\n\n### In your templates\n\nYou can use the `commonmark` **Twig** filter. You only need to pass it a *converter name*:\n```twig\n{{ markdown_content|commonmark('my_converter') }}\n```\n\u003eIf you have only 1 *converter* you can ommit the *converter name*.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faymdev%2Fcommonmarkbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faymdev%2Fcommonmarkbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faymdev%2Fcommonmarkbundle/lists"}