cakephp / cakephp-api-docs

CakePHP API Docs
http://api.cakephp.org
MIT License
29 stars 16 forks source link

@see does not generate link to reference class/method #104

Closed othercorey closed 5 years ago

othercorey commented 5 years ago

The attributes section under the method in the class listing does not generate a link for the referenced method in from the @see tag.

https://api.cakephp.org/3.7/class-Cake.Console.CommandCollection.html#_addMany

See \Cake\Console\CommandCollection::add()

markstory commented 5 years ago

We could probably separate the see annotation into a separate block like https://github.com/cakephp/cakephp-api-docs/blob/8139b106f59e3118525c0fc45bf248961fff396a/templates/cakephp/class.latte#L374-L381

We might be able to use the classUrl filter to make a link? It might get hard if the see tag contains other text though.

othercorey commented 5 years ago

Ok, I'm pretty far off on what's expected/allowed in @see after looking through cakephp source more. It can be pretty much anything. I don't know that we can check for each type well enough to generate an appropriate link.

othercorey commented 5 years ago

Took me a while to figure out where this is in api gen, but looks like the annotation filter is supposed to figure this out for us. Seems there is something causing it to fail.

https://github.com/ApiGen/ApiGen/blob/85290e8086f2f40e4d560de09ffd115466379dc2/packages/Annotation/src/AnnotationSubscriber/SeeUsesCoversAnnotationSubscriber.php#L66-L72

ADmad commented 5 years ago

@othercorey This repo is a fork of an old dev version of ApiGen. The ApiGen project has had a shaky life with development often stalling and restarting (and finally dead now) so we have just stuck with whats working for us in general, except for few issues like you have found.

othercorey commented 5 years ago

I noticed the issue talking about api gen being dead so I completely understand. I thought this would be an easy win, but looks like it isn't :(.

othercorey commented 5 years ago

Short follow up for anyone searching. It seems the attribute filter does generate a URL for a class types, but does not for method types. I actually found an example that contains both.

https://api.cakephp.org/3.7/class-Cake.Database.Query.html#_orWhere