Phpdocumentor在供应商目录中查找自定义模板

Ada*_*dam 16 php phpdoc twig phpdocumentor2

我需要为PhpDocumentor创建自定义模板.问题是template.xml,即使指定为绝对路径中定义的路径也未正确解析.PhpDocumentor在供应商目录中查找它们.

<template>
    <author>Code Mine</author>
    <email>office@code-mine.com</email>
    <description>Template for Confluence API</description>
    <version>1.0.0</version>
    <transformations>
        <transformation writer="twig" source="./index.html.twig" artifact="index.html"/>
        <transformation query="indexes.namespaces" writer="twig" source="./namespace.html.twig" />
        <transformation query="indexes.classes" writer="twig" source="./class.html.twig" />
    </transformations>
</template>
Run Code Online (Sandbox Code Playgroud)

尽管twig模板位于xml引用的路径中,但我收到文件不存在的错误.

编辑:

我还尝试设置所有配置细节,phpdoc.xml希望路径将被视为相对于配置文件,但没有运气.

The*_*der 1

如果您指定一个自定义模板,--template="..."它将(出于某种奇怪的原因)将整个模板与原始模板一起复制到供应商文件夹中,因此路径结构需要template.xml保持不变。你只需要改变例如。templates/clean/templates/yourtemplatename/

不过我有缓存问题。我无法让它每次都重新读取我的模板。它已将其缓存在某个地方,但我一生都无法弄清楚在哪里。文档真的很糟糕,来源更糟糕。

更新: 最后发现它将我的模板缓存在我计算机的临时文件夹中。对于 Windows 例如:c:\Users\<username>\AppData\Local\Temp\phpdoc-twig-cache\. 所以我只是删除整个文件夹。