如何更改phpdocumentor 2 Twig writer的文件扩展名

时间:2018-11-21 04:15:38

标签: phpdocumentor2

我正在尝试使用phpDocumentor 2模板输出markdown而不是html。我输出的markdown很好,但是无法更改类的文件名扩展名。

artifact仅在一次转换时有意义。使用query=indexes.classes时,如何确定文件名应为[class].html

我尝试过artifact="{CLASS}.md"artifact="{{CLASS}}.md"artifact=".md",但它总是按字面意义对待。

<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 个答案:

答案 0 :(得分:0)

我想这是阅读代码的问题。来自

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"/>
 *     ```
相关问题