PHPackages                             pomodocs/commonmark-template-renderer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. pomodocs/commonmark-template-renderer

ActiveCommonmark-extension[Templating &amp; Views](/categories/templating)

pomodocs/commonmark-template-renderer
=====================================

CommonMark extension to render html via template engines

v0.2(1mo ago)001[3 issues](https://github.com/pomodocs/commonmark-template-renderer/issues)MITPHPPHP &gt;=8.3CI passing

Since Apr 24Pushed 1mo agoCompare

[ Source](https://github.com/pomodocs/commonmark-template-renderer)[ Packagist](https://packagist.org/packages/pomodocs/commonmark-template-renderer)[ RSS](/packages/pomodocs-commonmark-template-renderer/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

CommonMark Template Renderer
============================

[](#commonmark-template-renderer)

### Render your markdown by your favorite template library

[](#render-your-markdown-by-your-favorite-template-library)

[![Test Suite](https://github.com/pomodocs/commonmark-template-renderer/actions/workflows/test.yml/badge.svg)](https://github.com/pomodocs/commonmark-template-renderer/actions/workflows/test.yml/badge.svg)[![Static Analysis](https://github.com/pomodocs/commonmark-template-renderer/actions/workflows/analysis.yml/badge.svg)](https://github.com/pomodocs/commonmark-template-renderer/actions/workflows/analysis.yml/badge.svg)[![Maintainability](https://camo.githubusercontent.com/a0a5a06b5fe611329a9d22c37ee067d0a0b124f00ff0bc02eb0c546bd0bc23e2/68747470733a2f2f716c74792e73682f67682f706f6d6f646f63732f70726f6a656374732f636f6d6d6f6e6d61726b2d74656d706c6174652d72656e64657265722f6d61696e7461696e6162696c6974792e737667)](https://qlty.sh/gh/pomodocs/projects/commonmark-template-renderer)[![Code Coverage](https://camo.githubusercontent.com/0370d2849a72db951137a37fcb00725d26a14e37dee4d1b5e464a0f3362c087e/68747470733a2f2f716c74792e73682f67682f706f6d6f646f63732f70726f6a656374732f636f6d6d6f6e6d61726b2d74656d706c6174652d72656e64657265722f636f7665726167652e737667)](https://qlty.sh/gh/pomodocs/projects/commonmark-template-renderer)[![GitHub](https://camo.githubusercontent.com/8f808373afd1d51fae0bff5cdddedba1d703e5c6f26996cc4a5d68c3a2fe1149/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706f6d6f646f63732f636f6d6d6f6e6d61726b2d74656d706c6174652d72656e6465726572)](https://camo.githubusercontent.com/8f808373afd1d51fae0bff5cdddedba1d703e5c6f26996cc4a5d68c3a2fe1149/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706f6d6f646f63732f636f6d6d6f6e6d61726b2d74656d706c6174652d72656e6465726572)

CommonMark Template Renderer Extension is an extension for [League CommonmMark](https://commonmark.thephpleague.com/) to render the html elements via your favorite template engine.

Warning

At the moment, we support only [Twig](https://twig.symfony.com/). We scheduled [Latte](https://latte.nette.org/), [Blade](https://github.com/EFTEC/BladeOne) and [Plates](https://platesphp.com/) support to version 1.0

Why render html elements via templates?
---------------------------------------

[](#why-render-html-elements-via-templates)

The answer is simple: easy html customization. And it's the only reason to use this library. In fact, the [defaul templates](https://github.com/pomodocs/commonmark-template-renderer/tree/master/resources/templates/default) generate exactly the same output as standard renderers. But template engines introduce some complexity and a little overhead so if you don't customize your html **you don't need to use this library**.

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

[](#installation)

Install the extension via [Composer](https://getcomposer.org):

```
composer require pomodocs/commonmark-template-renderer
```

Basic Usage
-----------

[](#basic-usage)

After installing it, register the extension in your [Commonmark Environment](https://commonmark.thephpleague.com/2.7/basic-usage/):

```
