PHPackages                             webuni/commonmark-twig-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. webuni/commonmark-twig-renderer

ActiveLibrary[Templating &amp; Views](/categories/templating)

webuni/commonmark-twig-renderer
===============================

The Twig renderer for CommonMark PHP implementation

0.2.0(9y ago)742731MITPHPPHP ^5.5|^7.0CI failing

Since Sep 27Pushed 5y ago2 watchersCompare

[ Source](https://github.com/webuni/commonmark-twig-renderer)[ Packagist](https://packagist.org/packages/webuni/commonmark-twig-renderer)[ Docs](https://github.com/webuni/commonmark-twig-renderer)[ RSS](/packages/webuni-commonmark-twig-renderer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (3)Used By (1)

CommonMark Twig Renderer
========================

[](#commonmark-twig-renderer)

[![Latest Stable Version](https://camo.githubusercontent.com/721bcc161780ac2e6f5642fd95dab18a47cc1b69725f4f5b9639d9cf27b822f6/68747470733a2f2f706f7365722e707567782e6f72672f776562756e692f636f6d6d6f6e6d61726b2d747769672d72656e64657265722f76657273696f6e)](https://packagist.org/packages/webuni/commonmark-twig-renderer)[![Build Status](https://camo.githubusercontent.com/fcc4f9a42d0c00833e8abd4a50a6fd1a898ba264ef5daab84e0ca55591cfb6cd/68747470733a2f2f7472617669732d63692e6f72672f776562756e692f636f6d6d6f6e6d61726b2d747769672d72656e64657265722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/webuni/commonmark-twig-renderer)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9a875e3082f29f00945f1671352cf75f2542124c5d073d7d658c55da2e12e71c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f776562756e692f636f6d6d6f6e6d61726b2d747769672d72656e64657265722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/webuni/commonmark-twig-renderer/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/01a474b6c8e072fff63a4ff4bbefb3fb9cc1ec78b2e4119e93b14ce78f4386b9/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f34633331333361312d316135622d346465342d393538612d6133636434623837663130662f6d696e692e706e67)](https://insight.sensiolabs.com/projects/4c3133a1-1a5b-4de4-958a-a3cd4b87f10f)

This extension allows you to use Twig templates to render CommonMark document.

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

[](#installation)

This project can be installed via Composer:

```
composer require webuni/commonmark-twig-renderer

```

Usage
-----

[](#usage)

```
    use League\CommonMark\CommonMarkConverter;
    use Webuni\CommonMark\TwigRenderer\CommonMarkTwig;

    $converter = new CommonMarkConverter();
    CommonMarkTwig::setTwigRenderer($converter);

    echo $converter->convertToHtml('# Hello World!');
```

Template customization
----------------------

[](#template-customization)

In Twig, each Commonmark Node is represented by a Twig block. To customize any part of how a node renders, you just need to override the appropriate block.

```
{% extends 'commonmark.html.twig' %}

{% block header -%}
    {% set content = block('_inline_children') -%}
    {{ content|raw }}
{%- endblock %}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~290 days

Total

2

Last Release

3596d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.4

0.2.0PHP ^5.5|^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/306adbad9084ed5c22aa85cbfce4899263466d76dff211b5c4c9f54dc23c40a1?d=identicon)[hason](/maintainers/hason)

---

Top Contributors

[![hason](https://avatars.githubusercontent.com/u/288535?v=4)](https://github.com/hason "hason (15 commits)")

---

Tags

twigmarkdowncommonmark

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/webuni-commonmark-twig-renderer/health.svg)

```
[![Health](https://phpackages.com/badges/webuni-commonmark-twig-renderer/health.svg)](https://phpackages.com/packages/webuni-commonmark-twig-renderer)
```

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91492.0M315](/packages/twig-extra-bundle)[twig/markdown-extra

A Twig extension for Markdown

12114.3M83](/packages/twig-markdown-extra)[twig/intl-extra

A Twig extension for Intl

36763.2M221](/packages/twig-intl-extra)[picocms/pico

Pico is a flat file CMS, this means there is no administration backend and database to deal with. You simply create .md files in the "content" folder and that becomes a page.

3.9k37.8k11](/packages/picocms-pico)[twig/string-extra

A Twig extension for Symfony String

22046.0M133](/packages/twig-string-extra)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

22918.5M55](/packages/twig-cssinliner-extra)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
