https://github.com/polarphp/apigen
PHP 7.1 ready Smart and Simple Documentation for your PHP project
https://github.com/polarphp/apigen
Last synced: 18 days ago
JSON representation
PHP 7.1 ready Smart and Simple Documentation for your PHP project
- Host: GitHub
- URL: https://github.com/polarphp/apigen
- Owner: polarphp
- License: other
- Created: 2019-02-17T23:06:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-11T22:54:49.000Z (about 7 years ago)
- Last Synced: 2025-03-15T09:41:26.593Z (over 1 year ago)
- Language: PHP
- Homepage: http://apigen.github.io/ApiGen/
- Size: 6.82 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Smart and Readable Documentation for your PHP project
[](https://travis-ci.org/ApiGen/ApiGen)
[](https://coveralls.io/github/ApiGen/ApiGen?branch=master)
[](https://packagist.org/packages/apigen/apigen/stats)
[](https://packagist.org/packages/apigen/apigen)
ApiGen is the simplest, the easiest to use and the most modern api doc generator. It is **all PHP 7.1 features ready**
easy to extend with own Finder, Annotation Subscriber or even Generator.
Just look at [**ApiGen API**](https://apigen.github.io/ApiGen):

## Your Help is Needed to Finish 5.x Release
:heart: We need your help to test new version of ApiGen.
### How to install it?
Add to your `composer.json`:
```json
{
"require": {
"apigen/apigen": "dev-master",
"roave/better-reflection": "dev-master#c87d856"
}
}
```
then update:
```bash
composer update
```
Test it, report issues or send PRs.
:skull: **Version 4.x is not supported**, since there was huge change of Reflection library and the code was almost completely rewritten.
## Built on Shoulders of Giants
- PHP 7.1+
- [nikic/PHP-Parser](https://github.com/nikic/PHP-Parser)
- [Roave/BetterReflection](https://github.com/Roave/BetterReflection)
- [phpDocumentor/TypeResolver](https://github.com/phpDocumentor/TypeResolver)
- [phpDocumentor/ReflectionDocBlock](https://github.com/phpDocumentor/ReflectionDocBlock)
## Install
```bash
composer require apigen/apigen --dev
```
## Usage
Generate API docs by passing single source and destination options:
```bash
vendor/bin/apigen generate src --destination docs
```
Or generate API docs for multiple directories:
```bash
vendor/bin/apigen generate src tests --destination docs
```
## Configuration
Below is a minimal example configuration. Save it as a `apigen.yml` file in
the root of your project:
```yaml
parameters:
visibilityLevels: [public, protected] # array
annotationGroups: [todo, deprecated] # array
title: "ApiGen Docs" # string
baseUrl: "http://apigen.org/api" # string
overwrite: false # bool
```
## What Annotations Have Extra Care?
### `@see`, `@covers`, `@uses`
Reference to Class, Function, Property, Method etc. element.
**In Code**
```php
/**
* @see SomeClass
* @see SomeClass::$propety
* @see SomeClass::someFunction()
*/
```
**Generated**
```html
@see SomeClass
@see SomeClass::$property
@see SomeClass::someFunction()
```
---
### `@link`
A website url.
**In Code**
```php
/**
* This is already mentioned on Wiki.
* @link https://en.wikipedia.org/wiki/United_we_stand,_divided_we_fall Click to see a cool quote
*/
```
**Generated**
```html
This is already mentioned on Wiki.
@link Click to see a cool quote
```
### `@internal`
Associated element is internal, so ApiGen hides it.
## Themes
To enable a custom theme just provide `themeDirectory` configuration option in your `apigen.yml`:
```yaml
parameters:
themeDirectory: path/to/theme # path to theme's config file
```
## Contributing
Rules are simple:
- **new feature needs tests**
- **all tests must pass**
```bash
composer complete-check
```
- **1 feature per PR**
We would be happy to merge your feature then.