phpDocumentor icon indicating copy to clipboard operation
phpDocumentor copied to clipboard

XML template leads to empty @see tags

Open tbpg opened this issue 4 years ago • 2 comments

This line:

     * This class is created internally by {@see Google\Cloud\Vision\Annotation} and is used to represent various
     * annotation feature results.

Leads to this with the XML template:

This class is created internally by {@see} and is used to represent various
annotation feature results.

It works with the default template:

<section class="phpdocumentor-description"><p>This class is created internally by <abbr title="\Google\Cloud\Vision\Annotation\Google\Cloud\Vision\Annotation">Annotation</abbr> and is used to represent various
annotation feature results.</p>

Is there a way to make the XML template include the @see tag? It works for some other tags, but many of them are missing.

tbpg avatar Aug 27 '21 18:08 tbpg

Hi could you give this a try.

create in your project a file .phpdoc/template/docblock.xml.twig with the following content:

{# @var descriptor \phpDocumentor\Descriptor\DescriptorAbstract #}
<docblock line="{{ descriptor.line }}">
    <description>{{ descriptor.summary }}</description>
    <long-description>{{ descriptor.description | description }}</long-description>
    {% for tags in descriptor.tags %}
        {% for tag in tags %}
        {% apply spaceless %}
        <tag
                name="{{ tag.name }}"
                description="{{ tag.description | description }}"
                {% if tag.link %} link="{{ tag.link }}"{% endif %}
                {% if tag.version %} version="{{ tag.version }}"{% endif %}
                {% if tag.reference %} link="{{ tag.reference }}"{% endif %}
                {% if tag.variableName %} variable="{{ tag.variableName }}"{% endif %}
                {% if tag.methodName %} method_name="{{ tag.methodName }}"{% endif %}
                {% if tag.type %} type="{{ tag.type }}"{% endif %}/>
        {% endapply %}

        {% endfor %}
    {% endfor %}
</docblock>

Then rerun phpdocumentor.

This will overwrite the way docblocks are rendered on your project in the xml.

I would like to hear if this fixes the issues you are facing.

jaapio avatar Sep 07 '21 19:09 jaapio

Thanks! That leads to:

This class is created internally by &lt;a href=&quot;classes/Google-Cloud-Vision-Annotation.html&quot;&gt;&lt;abbr title=&quot;\Google\Cloud\Vision\Annotation&quot;&gt;Annotation&lt;/abbr&gt;&lt;/a&gt; and is used

Is there a way to avoid the escaping? Or perhaps even leaving the @see unchanged (so I can resolve it after the fact)?

tbpg avatar Sep 14 '21 14:09 tbpg