PHPackages                             machy8/macdom - 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. machy8/macdom

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

machy8/macdom
=============

The best, highly customizable HTML preprocessor with many amazing features.

v3.0.0(8y ago)1321431New BSD LicensePHPPHP &gt;=7.0

Since Mar 30Pushed 6y ago2 watchersCompare

[ Source](https://github.com/Machy8/Macdom)[ Packagist](https://packagist.org/packages/machy8/macdom)[ RSS](/packages/machy8-macdom/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (3)Versions (7)Used By (1)

Macdom
======

[](#macdom)

[![Build Status](https://camo.githubusercontent.com/412008c04cbeb28f62975ce3257488a7c4d9388e3041024b390e9113e44d64c0/68747470733a2f2f7472617669732d63692e6f72672f4d61636879382f4d6163646f6d2e7376673f6272616e63683d332e30)](https://travis-ci.org/Machy8/Macdom)[![Coverage Status](https://camo.githubusercontent.com/6df1984ef8842d680e2abd7db356e5e09175913a8c4bb05d11546c9f2d7dedc6/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4d61636879382f4d6163646f6d2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Machy8/Macdom?branch=master)[![Packagist](https://camo.githubusercontent.com/6ae3738b01a28c656c99aded345f3276dc69be2f302b0504cf5be0e743ddeb8e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61636879382f6d6163646f6d2e7376673f6d61784167653d32353932303030)](https://packagist.org/packages/machy8/macdom)[![License](https://camo.githubusercontent.com/fa7d5fcf2c84b580327af52da95dd751703af65f079dc3c5a0081beac0789718/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4e65772532304253442d626c75652e737667)](https://github.com/Machy8/Macdom/blob/master/license.md)[![Join the chat at https://gitter.im/Machy8/Macdom](https://camo.githubusercontent.com/3a6f37d81e962f4de4169ef3dd4d495d393c1826b602105705944e64ba7a33f4/68747470733a2f2f6261646765732e6769747465722e696d2f4d61636879382f4d6163646f6d2e737667)](https://gitter.im/Machy8/Macdom?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

- For more information see [WIKI](https://github.com/Machy8/Macdom/wiki) *(always up to date to the newest stable version)*
- **[Try it on CODEPEN](http://codepen.io/Machy8/pen/mPLdbg)** *(JavaScript version is always behind the php version so it may contain bugs and errors that have already been fixed in the PHP version)*

Sample
------

[](#sample)

**Macdom**

```
!5
html
    head
        utf-8
        viewport
        favicon includes/favicon.ico
        title Macdom example
    body
        h1 #title .titles .main-title Hello world
        nav
            @ a $http://www.[@].com $blank Link on -
            [google] .first-link Google
            [yahoo] Yahoo
            [github] Github
        div #wrapper Some text here.
        https://www.code.jquery.com/jquery-1.12.0.min.js async
```

**Result**

```
>

		Macdom example

		Hello world

			Link on - Google
			Link on - Yahoo
			Link on - Github

			Some text here.

```

Requirements
------------

[](#requirements)

- PHP 7.0+
- If you use Nette Framework - v2.3+

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

[](#installation)

**1 - Download the Macdom using composer:**

```
 composer require machy8/macdom

```

**2 - Usage:**

*Typical:*

```
$macdom = new Macdom\Engine;
$compiled = $macdom->compile($content);
```

*Nette framework:*

```
use Macdom\Bridges\Latte\FileLoader;
use Macdom\Engine;

/**
 * @var Engine
 */
private $macdom;

/**
 * @var FileLoader
 */
private $fileLoader;

public function __construct(Engine $macdom, FileLoader $fileLoader) {
	$this->macdom = $macdom;
	$this->fileLoader = $fileLoader;
}

protected function createTemplate()
{
	$template = parent::createTemplate();
	$this->fileLoader->setMacdom($this->macdom);
	$template->getLatte()->setLoader($this->fileLoader);
	return $template;
}
```

And add a config neon file with the following content (or try [Composer synchronizer](https://github.com/composer-synchronizer/composer-synchronizer). It will do it for you automatically).

```
extensions:
    macdom: Macdom\Bridges\Nette\MacdomExtension

macdom:
    debugger: TRUE

```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 99.7% 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 ~111 days

Recently: every ~132 days

Total

6

Last Release

3191d ago

Major Versions

v1.3.0 → v2.0.02016-04-29

2.0.x-dev → v3.0.02017-10-08

PHP version history (3 changes)v1.3.0PHP &gt;=5.3.0

v2.1.0PHP &gt;=5.4.0

v3.0.0PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14016808?v=4)[Vladimír Macháček](/maintainers/Machy8)[@Machy8](https://github.com/Machy8)

---

Top Contributors

[![Machy8](https://avatars.githubusercontent.com/u/14016808?v=4)](https://github.com/Machy8 "Machy8 (327 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

---

Tags

html-preprocessorminificationpreprocessorsimplificationtemplatinghtmltemplatingminificationpreprocessormacdom

### Embed Badge

![Health badge](/badges/machy8-macdom/health.svg)

```
[![Health](https://phpackages.com/badges/machy8-macdom/health.svg)](https://phpackages.com/packages/machy8-macdom)
```

###  Alternatives

[twig/twig

Twig, the flexible, fast, and secure template language for PHP

8.7k465.7M7.2k](/packages/twig-twig)[phpoffice/phpword

PHPWord - A pure PHP library for reading and writing word processing documents (OOXML, ODF, RTF, HTML, PDF)

7.6k39.0M235](/packages/phpoffice-phpword)[mustache/mustache

A Mustache implementation in PHP.

3.3k47.6M324](/packages/mustache-mustache)[smarty/smarty

Smarty - the compiling PHP template engine

2.4k41.8M457](/packages/smarty-smarty)[laminas/laminas-view

Fast and type safe HTML templating library with a flexible plugin system supporting multistep template composition

7528.4M269](/packages/laminas-laminas-view)[twig/string-extra

A Twig extension for Symfony String

22150.9M230](/packages/twig-string-extra)

PHPackages © 2026

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