tomflidr / apigen
PHP 7.1 source code API generator.
Requires
- php: ^7.1
- kukulich/fshl: ^2.1
- latte/latte: ^2.4
- nette/finder: ^2.4
- nette/neon: ^2.4
- nette/utils: ^2.4
- phpdocumentor/reflection-docblock: ^3.1
- psr/container: ^1.0
- roave/better-reflection: dev-master#a402048
- symfony/config: ^3.3
- symfony/console: ^3.3
- symfony/dependency-injection: ^3.3
- symfony/finder: ^3.3
- symfony/http-kernel: ^3.3
- symfony/yaml: ^3.3
- symplify/package-builder: ^2.2
- zendframework/zend-code: ^3.1
Requires (Dev)
- phpstan/phpstan: ^0.8
- phpunit/phpunit: ^6.0
- symplify/easy-coding-standard: ^2.2
- tracy/tracy: ^2.4
This package is auto-updated.
Last update: 2024-10-26 05:26:26 UTC
README
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:
Your Help is Needed to Finish 5.x Release
❤️ We need your help to test new version of ApiGen.
How to install it?
Add to your composer.json
:
{ "require": { "apigen/apigen": "dev-master", "roave/better-reflection": "dev-master#c87d856" } }
then update:
composer update
Test it, report issues or send PRs.
💀 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
- Roave/BetterReflection
- phpDocumentor/TypeResolver
- phpDocumentor/ReflectionDocBlock
Install
composer require apigen/apigen --dev
Usage
Generate API docs by passing single source and destination options:
vendor/bin/apigen generate src --destination docs
Or generate API docs for multiple directories:
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:
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
/** * @see SomeClass * @see SomeClass::$propety * @see SomeClass::someFunction() */
Generated
@see <a href="class-SomeClass.html">SomeClass</a> @see <a href="class-SomeClass.html#$someProperty">SomeClass::$property</a> @see <a href="class-SomeClass.html#_someFunction">SomeClass::someFunction()</a>
@link
A website url.
In Code
/** * 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
This is already mentioned on Wiki. @link <a href="https://en.wikipedia.org/wiki/United_we_stand,_divided_we_fall">Click to see a cool quote</a>
@internal
Associated element is internal, so ApiGen hides it.
Themes
To enable a custom theme just provide themeDirectory
configuration option in your apigen.yml
:
parameters: themeDirectory: path/to/theme # path to theme's config file
Contributing
Rules are simple:
- new feature needs tests
- all tests must pass
composer complete-check
- 1 feature per PR
We would be happy to merge your feature then.