{"id":14966330,"url":"https://github.com/yiisoft/yii2-apidoc","last_synced_at":"2025-05-14T14:07:54.078Z","repository":{"id":12986872,"uuid":"15665754","full_name":"yiisoft/yii2-apidoc","owner":"yiisoft","description":"Yii 2 apidoc extension.","archived":false,"fork":false,"pushed_at":"2025-02-13T21:08:27.000Z","size":614,"stargazers_count":257,"open_issues_count":21,"forks_count":122,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-05-02T22:26:14.931Z","etag":null,"topics":["api-documentation","documentation","generator","hacktoberfest","phpdoc","yii","yii2"],"latest_commit_sha":null,"homepage":"https://www.yiiframework.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yiisoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["yiisoft"],"open_collective":"yiisoft","tidelift":"packagist/yiisoft/yii2-apidoc"}},"created_at":"2014-01-06T05:04:01.000Z","updated_at":"2025-02-13T21:08:30.000Z","dependencies_parsed_at":"2023-01-13T17:14:38.464Z","dependency_job_id":"e5895a0c-2b7d-48b1-94f2-039a9b4555e6","html_url":"https://github.com/yiisoft/yii2-apidoc","commit_stats":{"total_commits":398,"total_committers":34,"mean_commits":"11.705882352941176","dds":0.5226130653266332,"last_synced_commit":"3c1875e750b849b352238b258f8f471e5b42b978"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii2-apidoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii2-apidoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii2-apidoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii2-apidoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiisoft","download_url":"https://codeload.github.com/yiisoft/yii2-apidoc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252839680,"owners_count":21812148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-documentation","documentation","generator","hacktoberfest","phpdoc","yii","yii2"],"created_at":"2024-09-24T13:36:13.767Z","updated_at":"2025-05-14T14:07:54.057Z","avatar_url":"https://github.com/yiisoft.png","language":"PHP","funding_links":["https://github.com/sponsors/yiisoft","https://opencollective.com/yiisoft","https://tidelift.com/funding/github/packagist/yiisoft/yii2-apidoc"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/yiisoft\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://avatars0.githubusercontent.com/u/993323\" height=\"100px\"\u003e\n    \u003c/a\u003e\n    \u003ch1 align=\"center\"\u003eAPI documentation generator for Yii 2\u003c/h1\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\nThis extension provides an API documentation generator for the [Yii framework 2.0](https://www.yiiframework.com).\n\nFor license information check the [LICENSE](LICENSE.md)-file.\n\n[![Latest Stable Version](https://poser.pugx.org/yiisoft/yii2-apidoc/v/stable.png)](https://packagist.org/packages/yiisoft/yii2-apidoc)\n[![Total Downloads](https://poser.pugx.org/yiisoft/yii2-apidoc/downloads.png)](https://packagist.org/packages/yiisoft/yii2-apidoc)\n[![Build Status](https://github.com/yiisoft/yii2-apidoc/workflows/build/badge.svg)](https://github.com/yiisoft/yii2-apidoc/actions)\n\n\nInstallation\n------------\n\nThe preferred way to install this extension is through [composer](https://getcomposer.org/download/).\n\nEither run\n\n```\ncomposer require --prefer-dist yiisoft/yii2-apidoc:\"~3.0.6\"\n```\n\nThe above command may not work on an existing project due to version conflicts that need to be resolved, so it\nis preferred to add the package manually to the `require` section of your composer.json:\n\n```json\n\"yiisoft/yii2-apidoc\": \"~3.0.6\"\n```\n\nafterwards run `composer update`. You may also run `composer update yiisoft/yii2-apidoc cebe/markdown` if you\nwant to avoid updating unrelated packages.\n\n\nUsage\n-----\nThis extension creates executable at `/vendor/bin`. Please do change directory to that directory if you  do not want to use full path i.e `/vendor/bin/apidoc` and use just the executable name as with below examples.\n\nThis extension offers two commands:\n\n1)`api` to generate class API documentation. [phpDocumentor](https://www.phpdoc.org/) is used as a base framework\n  so refer to its guide for the syntax.\n\nThe output of `help api` command (i.e `apidoc help api`):\n\n```\nDESCRIPTION\n\nRenders API documentation files\n\n\nUSAGE\n\napidoc api \u003csourceDirs\u003e \u003ctargetDir\u003e [...options...]\n\n- sourceDirs (required): array\n\n- targetDir (required): string\n\n\nOPTIONS\n\n--appconfig: string\n  custom application configuration file path.\n  If not set, default application configuration is used.\n\n--color: boolean, 0 or 1\n  whether to enable ANSI color in the output.\n  If not set, ANSI color will only be enabled for terminals that support it.\n\n--exclude: string|array\n  files to exclude.\n\n--guide: string\n  url to where the guide files are located\n\n--guide-prefix: string (defaults to 'guide-')\n  prefix to prepend to all guide file names.\n\n--help, -h: boolean, 0 or 1 (defaults to 0)\n  whether to display help information about current command.\n\n--interactive: boolean, 0 or 1 (defaults to 1)\n  whether to run the command interactively.\n\n--page-title: string\n\n--repo-url: string\n  Repository url (e.g. \"https://github.com/yiisoft/yii2\"). Optional, used for resolving relative links\n  within a repository (e.g. \"[docs/guide/README.md](docs/guide/README.md)\"). If you don't have such links you can\n  skip this. Otherwise, skipping this will cause generation of broken links because they will be not resolved and\n  left as is.\n\n--silent-exit-on-exception: boolean, 0 or 1\n  if true - script finish with `ExitCode::OK` in case of exception.\n  false - `ExitCode::UNSPECIFIED_ERROR`.\n  Default: `YII_ENV_TEST`\n\n--template: string (defaults to 'bootstrap')\n  template to use for rendering\n```\n\n2)`guide` to render nice HTML pages from markdown files such as the yii guide.\n\nThe output of `help guide` command (i.e `apidoc help guide`):\n\n```\nDESCRIPTION\n\nRenders API documentation files\n\n\nUSAGE\n\napidoc guide \u003csourceDirs\u003e \u003ctargetDir\u003e [...options...]\n\n- sourceDirs (required): array\n\n- targetDir (required): string\n\n\nOPTIONS\n\n--api-docs: string\n  path or URL to the api docs to allow links to classes and properties/methods.\n\n--appconfig: string\n  custom application configuration file path.\n  If not set, default application configuration is used.\n\n--color: boolean, 0 or 1\n  whether to enable ANSI color in the output.\n  If not set, ANSI color will only be enabled for terminals that support it.\n\n--exclude: string|array\n  files to exclude.\n\n--guide-prefix: string (defaults to 'guide-')\n  prefix to prepend to all output file names generated for the guide.\n\n--help, -h: boolean, 0 or 1 (defaults to 0)\n  whether to display help information about current command.\n\n--interactive: boolean, 0 or 1 (defaults to 1)\n  whether to run the command interactively.\n\n--page-title: string\n\n--silent-exit-on-exception: boolean, 0 or 1\n  if true - script finish with `ExitCode::OK` in case of exception.\n  false - `ExitCode::UNSPECIFIED_ERROR`.\n  Default: `YII_ENV_TEST`\n\n--template: string (defaults to 'bootstrap')\n  template to use for rendering\n```\n\nSimple usage for stand-alone class documentation:\n\n    vendor/bin/apidoc api source/directory ./output\n\nSimple usage for stand-alone guide documentation:\n\n    vendor/bin/apidoc guide source/docs ./output\n\nNote that in order to generate a proper index file, the `README.md` file containing links to guide sections must be \npresent. An example of such file can be found \nin the [yii2 repository](https://raw.githubusercontent.com/yiisoft/yii2/master/docs/guide/README.md).\n\nYou can combine them to generate class API and guide documentation in one place:\n\n    # generate API docs\n    vendor/bin/apidoc api source/directory ./output\n    # generate the guide (order is important to allow the guide to link to the apidoc)\n    vendor/bin/apidoc guide source/docs ./output\n\nBy default, the `bootstrap` template will be used. You can choose a different template with the `--template=name` parameter.\nCurrently, there is only the `bootstrap` template available.\n\nYou may also add the `yii\\apidoc\\commands\\ApiController` and `GuideController` to your console application command map\nand run them inside your application's console app.\n\n### Generating docs from multiple sources\n\nThe apidoc generator can use multiple directories, so you can generate docs for your application and include the yii framework\ndocs to enable links between your classes and framework classes. This also allows `@inheritdoc` to work\nfor your classes that extend from the framework.\nUse the following command to generate combined api docs:\n\n    ./vendor/bin/apidoc api ./vendor/yiisoft/yii2,. docs/json --exclude=\"docs,vendor\"\n    \nThis 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).\n\n### Advanced usage\n\nThe following script can be used to generate API documentation and guide in different directories and also multiple guides\nin different languages (like it is done on yiiframework.com):\n\n```sh\n#!/bin/sh\n\n# set these paths to match your environment\nYII_PATH=~/dev/yiisoft/yii2\nAPIDOC_PATH=~/dev/yiisoft/yii2/extensions/apidoc\nOUTPUT=yii2docs\n\ncd $APIDOC_PATH\n./apidoc api $YII_PATH/framework/,$YII_PATH/extensions $OUTPUT/api --guide=../guide-en --guidePrefix= --interactive=0\n./apidoc guide $YII_PATH/docs/guide    $OUTPUT/guide-en --apiDocs=../api --guidePrefix= --interactive=0\n./apidoc guide $YII_PATH/docs/guide-ru $OUTPUT/guide-ru --apiDocs=../api --guidePrefix= --interactive=0\n# repeat the last line for more languages\n```\n\n### Creating a PDF of the guide\n\nPrerequisites:\n\n- `pdflatex`.\n- [Pygments](https://pygments.org/).\n- GNU `make`.\n\nGeneration:\n\n```\nvendor/bin/apidoc guide source/docs ./output --template=pdf\ncd ./output\nmake pdf\n```\n\nIf all runs without errors the PDF will be `guide.pdf` in the `output` dir.\n\nSpecial Markdown Syntax\n-----------------------\n\nWe have a special Syntax for linking to a class in the API documentation.\nSee the [code style guide](https://github.com/yiisoft/yii2/blob/master/docs/internals/core-code-style.md#markdown) for details.\n\nCreating your own templates\n---------------------------\n\nTBD\n\nUsing the model layer\n---------------------\n\nTBD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiisoft%2Fyii2-apidoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiisoft%2Fyii2-apidoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiisoft%2Fyii2-apidoc/lists"}