Skip to content

Automatic generation of Twig documentation.

License

Notifications You must be signed in to change notification settings

cvc-digital/twig-documentor

Repository files navigation

Twig Documentor

Continuous Integration codecov Packagist Psalm coverage GitHub license

Automatically generates documentation for Twig extensions.

Installation

composer require --dev cvc/twig-documentor

Usage

<?php

$environment = new \Twig\Environment(new \Twig\Loader\ArrayLoader());
$environmentDescriber = new \Cvc\TwigDocumentor\Describer\EnvironmentDescriber(
    new \Cvc\TwigDocumentor\Describer\FunctionDescriber(\phpDocumentor\Reflection\DocBlockFactory::createInstance()),
    new \Cvc\TwigDocumentor\Describer\FilterDescriber(\phpDocumentor\Reflection\DocBlockFactory::createInstance())
);
$documentation = $environmentDescriber->describe($environment);
$documentation = $documentation->withSource(__DIR__.'/*');

Development Team


Markus Poerschke

Developer