Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using {@inheritdoc} in apidoc #7789

Closed
vladim1 opened this issue Mar 19, 2015 · 6 comments
Closed

Using {@inheritdoc} in apidoc #7789

vladim1 opened this issue Mar 19, 2015 · 6 comments

Comments

@vladim1
Copy link

vladim1 commented Mar 19, 2015

I am using {inheritdoc} inline tag to inherit the parent description.

    /**
     * {@inheritdoc}
     */
    public function beforeAction($action)
    {
    ...
    }

After generating documentation with yii2-apidoc I am expecting to get parent description in the description section, but I am getting {@inheritdoc} as a text.

vendor/bin/apidoc api /var/www/project.com /home/user/doc

Is {@inheritdoc} support is turned off or I have missed something?

UPD: it looks like the reason {inheritdoc} doesn't work is because apidoc doesn't know where the parent class is situated.
In my case the parent class is yii\web\AssetBundle.
I think so, because the apidoc doesn't create the link to yii\web\AssetBundle. I am using advanced application template. How can I force apidoc to analyze vendor folder. As was mentioned before I specified the project folder(which includes frontend,backend, vendor).

@samdark
Copy link
Member

samdark commented Mar 19, 2015

It's supported but w/o { and }.

@samdark samdark added this to the website and infrastructure milestone Mar 19, 2015
@vladim1
Copy link
Author

vladim1 commented Mar 19, 2015

@samdark
I have updated my post just before your answer. Please, see UPD section in the first post.

In my case {@inheritdoc} doesn't work without { and } either. But in this case the generated description is blank.

@cebe
Copy link
Member

cebe commented Mar 19, 2015

To include vendor classes in the api documentation you have to add their path to the input directory. You can have many input directories separated by comma:

./apidoc api app/,vendor/yiisoft,...

@vladim1
Copy link
Author

vladim1 commented Mar 19, 2015

I have tried to include vendor/yiisoft dir as an input directory. From the project dir:

vendor/bin/apidoc api backend,frontend,vendor/yiisoft,common,console /home/user/doc

The result is pretty weird.
First of all the apidoc has created all web pages. But in the index.html file I can see only the menu for yii classes (from vendor folder).

file:///home/user/doc/index.html

And there are no classes from backend, console, frontend, common folders.
When I put the full path to the generated page, like

file:///home/user/doc/backend-assets-appasset.html

I can see all the packages (common, frontend, backend, console) in the left menu except the classes from vendor folder. Why is it happening?
And the inheritance still doesn't work. I used @inheritdoc without curly brackets. The result is blank. When I user {@inheritdoc} the result is {@inheritdoc} as a text in the description.

@cebe
Copy link
Member

cebe commented Mar 19, 2015

well, the apidoc command is not well suited for application documentation yet and is very specific for yii framework docs itself. You may need to make adjustments to the templates in some places.

@cebe
Copy link
Member

cebe commented Nov 27, 2016

duplicate of #11635

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants