All Projects → yiisoft → Yii2 Apidoc

yiisoft / Yii2 Apidoc

Licence: bsd-3-clause
Yii 2 apidoc extension.

Projects that are alternatives of or similar to Yii2 Apidoc

Pdoc
🐍 ➡️ 📜 Auto-generate API documentation for Python projects
Stars: ✭ 604 (+155.93%)
Mutual labels:  api-documentation, hacktoberfest, documentation, generator
Yii2 Smarty
Yii 2 Smarty Extension.
Stars: ✭ 67 (-71.61%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 Gii
Yii 2 Gii Extension
Stars: ✭ 183 (-22.46%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2
Yii 2: The Fast, Secure and Professional PHP Framework
Stars: ✭ 13,852 (+5769.49%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 Bootstrap
Yii 2 Bootstrap 3 Extension
Stars: ✭ 177 (-25%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 App Basic
Yii 2.0 Basic Application Template
Stars: ✭ 548 (+132.2%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 Sphinx
Yii 2 Sphinx extension.
Stars: ✭ 172 (-27.12%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 Elasticsearch
Yii 2 Elasticsearch extension
Stars: ✭ 401 (+69.92%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 Swiftmailer
Yii 2 swiftmailer extension.
Stars: ✭ 109 (-53.81%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 App Advanced
Yii 2.0 Advanced Application Template
Stars: ✭ 1,569 (+564.83%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 Jui
Yii 2 JQuery UI extension.
Stars: ✭ 120 (-49.15%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 Debug
Debug Extension for Yii 2
Stars: ✭ 179 (-24.15%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 Redis
Yii 2 Redis extension.
Stars: ✭ 416 (+76.27%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 Twig
Yii 2 Twig extension.
Stars: ✭ 130 (-44.92%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 Httpclient
Yii 2 HTTP client
Stars: ✭ 406 (+72.03%)
Mutual labels:  hacktoberfest, yii2, yii
Jsdoc To Markdown
Generate markdown documentation from jsdoc-annotated javascript
Stars: ✭ 1,199 (+408.05%)
Mutual labels:  api-documentation, documentation, generator
Yii2 Docker
Official Docker images suitable for Yii 2.0
Stars: ✭ 286 (+21.19%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 Mongodb
Yii 2 MongoDB extension
Stars: ✭ 299 (+26.69%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 Openapi
REST API application generator for Yii2, openapi 3.0 YAML -> Yii2
Stars: ✭ 99 (-58.05%)
Mutual labels:  hacktoberfest, yii2, yii
Yii2 Shell
Interactive shell
Stars: ✭ 129 (-45.34%)
Mutual labels:  hacktoberfest, yii2, yii

API documentation generator for Yii 2


This extension provides an API documentation generator for the Yii framework 2.0.

For license information check the LICENSE-file.

Latest Stable Version Total Downloads Build Status

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist yiisoft/yii2-apidoc

The above command may not work on an existing project due to version conflicts that need to be resolved, so it is preferred to add the package manually to the require section of your composer.json:

"yiisoft/yii2-apidoc": "~2.1.0"

afterwards run composer update. You may also run composer update yiisoft/yii2-apidoc cebe/markdown if you want to avoid updating unrelated packages.

Usage

This extension offers two commands:

  • api to generate class API documentation. phpDocumentor is used as a base framework so refer to its guide for the syntax.
  • guide to render nice HTML pages from markdown files such as the yii guide.

Simple usage for stand-alone class documentation:

vendor/bin/apidoc api source/directory ./output

Simple usage for stand-alone guide documentation:

vendor/bin/apidoc guide source/docs ./output

You can combine them to generate class API and guide documentation in one place:

# generate API docs
vendor/bin/apidoc api source/directory ./output
# generate the guide (order is important to allow the guide to link to the apidoc)
vendor/bin/apidoc guide source/docs ./output

By default, the bootstrap template will be used. You can choose a different template with the --template=name parameter. Currently, there is only the bootstrap template available.

You may also add the yii\apidoc\commands\ApiController and GuideController to your console application command map and run them inside of your applications console app.

Generating docs from multiple sources

The apidoc generator can use multiple directories, so you can generate docs for your application and include the yii framework docs to enable links between your classes and framework classes. This also allows @inheritdoc to work for your classes that extend from the framework. Use the following command to generate combined api docs:

./vendor/bin/apidoc api ./vendor/yiisoft/yii2,. docs/json --exclude="docs,vendor"

This will read the source files from ./vendor/yiisoft/yii2 directory and . which is the current directory (you may replace this with the location of your code if it is not in the current working directory).

Advanced usage

The following script can be used to generate API documentation and guide in different directories and also multiple guides in different languages (like it is done on yiiframework.com):

#!/bin/sh

# set these paths to match your environment
YII_PATH=~/dev/yiisoft/yii2
APIDOC_PATH=~/dev/yiisoft/yii2/extensions/apidoc
OUTPUT=yii2docs

cd $APIDOC_PATH
./apidoc api $YII_PATH/framework/,$YII_PATH/extensions $OUTPUT/api --guide=../guide-en --guidePrefix= --interactive=0
./apidoc guide $YII_PATH/docs/guide    $OUTPUT/guide-en --apiDocs=../api --guidePrefix= --interactive=0
./apidoc guide $YII_PATH/docs/guide-ru $OUTPUT/guide-ru --apiDocs=../api --guidePrefix= --interactive=0
# repeat the last line for more languages

Creating a PDF of the guide

You need pdflatex and GNU make for this.

vendor/bin/apidoc guide source/docs ./output --template=pdf
cd ./output
make pdf

If all runs without errors the PDF will be guide.pdf in the output dir.

Special Markdown Syntax

We have a special Syntax for linking to classes in the API documentation. See the code style guide for details.

Creating your own templates

TBD

Using the model layer

TBD

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].