How to change the file extension for phpdocumentor 2 twig writer

109 views Asked by At

I'm trying to output markdown instead of html with a phpDocumentor 2 template. I am outputting markdown fine but not able to change the filename extension for classes.

The artifact makes sense when it's a single transformation. When query=indexes.classesis used how does it decide that the filename should be [class].html?

I've tried artifact="{CLASS}.md", artifact="{{CLASS}}.md", artifact=".md" but it always treats them literally.

<transformations> <transformation query="indexes.classes" writer="twig" source="templates/docsify-twig/class.md.twig" /> <transformation writer="twig" source="templates/responsive-twig/reports/markers.html.twig" artifact="markers.html"/> </transformations>

1

There are 1 answers

0
Dustin Butler On

I guess it's a matter of reading the code. From

https://github.com/phpDocumentor/phpDocumentor2/blob/develop/src/phpDocumentor/Plugin/Twig/Writer/Twig.php

 * A complex example transformation line could be:
 *
 *     ```
 *     <transformation
 *         query="indexes.classes"
 *         writer="twig"
 *         source="templates/twig/class.twig"
 *         artifact="{{name}}.html"/>
 *     ```