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

How can I create documentation for my app? #131

Open
AntoninSlejska opened this issue Jan 5, 2017 · 5 comments
Open

How can I create documentation for my app? #131

AntoninSlejska opened this issue Jan 5, 2017 · 5 comments
Assignees
Labels
type:enhancement Enhancement

Comments

@AntoninSlejska
Copy link

I create API documentation with the following command:
vendor/bin/apidoc api 'backend,frontend,common,vendor/yiisoft,...' ./../apidocs

In index.html is then documentation for namespaces yii, yii\base,... but not for namespaces from my application. Files containing documentation for my application are created, but with navigation containing all namespaces, which are not in index.html.

Is it possible to create e.g. app-index.html with navigation consisting only from namespaces from my application?

@cebe cebe added the type:enhancement Enhancement label Jan 5, 2017
@cebe cebe added this to the 2.1.1 milestone Jan 5, 2017
@ricpelo
Copy link
Contributor

ricpelo commented Jan 8, 2017

That would be great.

@hujuice
Copy link

hujuice commented Dec 25, 2017

I think that simply index.html should list the application index, not app-index.html.
The yii docs are elsewhere and they are replicated here only to ensure the links to the running version.

@hujuice
Copy link

hujuice commented Dec 25, 2017

For folks waiting, I wrote this very simple script as workaround.
I don't know if it can cause cache collisions. At glance, it works for me.

#!/bin/sh

# Define your paths here
PROJECT_PATH=/path/to/project
DOCS_PATH=/path/to/docs

cd $PROJECT_PATH

# Generate the api docs without yii and save the index.html
vendor/bin/apidoc api . $DOCS_PATH --exclude="docs,environments,local,vendor" --guide=. --pageTitle="My app Class Reference" --interactive=0
mv local/docs/index.html local/docs/app-index.html

# Generate the api docs with yii and save the index.html
vendor/bin/apidoc api vendor/yiisoft/yii2,. $DOCS_PATH --exclude="docs,environments,local,vendor" --guide=. --pageTitle="My app Class Reference" --interactive=0
mv local/docs/index.html local/docs/yii-index.html

# Symlink the wanted index.html
ln -s app-index.html local/docs/index.html

# Generate the guide
vendor/bin/apidoc guide docs $DOCS_PATH --apiDocs=. --pageTitle="My app Guide" --interactive=0

Regards,
HUjuice

@jevansloreto
Copy link

jevansloreto commented Apr 11, 2018

I adapted @hujuice 's script to just get the documentation for my app, but it's still only showing the Yii class on the index page, and there's no app-index.html page either:

vendor/bin/apidoc api . ../docs/generated --exclude="docs,environments,local,vendor" --guide=. --pageTitle="My app Class Reference" --interactive=0

This is running in the basic folder of the basic app. Any update on this?

@cebe cebe modified the milestones: 2.1.1, 2.1.2 Nov 14, 2018
@samdark samdark removed this from the 2.1.2 milestone Aug 20, 2019
@honsa
Copy link

honsa commented Aug 28, 2019

Looks like the yii2-apidocs is at this moment not ready to generate docs for your own application.

You have to create a new template and play with apidoc generator and put all together.

yiisoft/yii2#7789 (comment)

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

No branches or pull requests

7 participants