PHP Classes

PHP API Document Generator: Generate automatic documentation for APIs

Recommend this page to a friend!
  Info   View files Example   View files View files (19)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 110 This week: 1All time: 9,624 This week: 560Up
Version License PHP version Categories
api_document_builder 1.0GNU Lesser Genera...5HTML, PHP 5, Project Management
Description 

Author

This package can be used to generate automatic documentation for APIs.

It provides a script to be run from the command line to use a given configuration script that specifies the details of several APIs to generate documentation.

The package uses the APIGen to generate documentation for those projects and created an index.html page to link to the generated documentation.

It can also pull the project of a Git repository to check if the documentation needs to be generated.

Innovation Award
PHP Programming Innovation award nominee
March 2020
Number 6
APIs are nowadays a very popular way to allow external Web sites and applications to interact with other sites, thus benefiting from the services that they provide.

Some APIs are already so complex that it takes a lot of time to document the API functions and update the documentation when the API evolves.

This package helps automating the generation of documentation of an API, so developers to not have to spend so much time producing that documentation.

Manuel Lemos
Picture of nvb
  Performance   Level  
Name: nvb <contact>
Classes: 20 packages by
Country: Germany Germany
Age: ???
All time rank: 150195 in Germany Germany
Week rank: 109 Up6 in Germany Germany Up
Innovation award
Innovation award
Nominee: 12x

Winner: 1x

Example

#!/usr/bin/env php
<?php
/**
 * @author stev leibelt <artodeto@bazzline.net>
 * @since 2015-05-24
 */

$possiblePathsToComposerAutoloadFile = array(
   
__DIR__ . '/../../../autoload.php',
   
__DIR__ . '/../../vendor/autoload.php',
   
__DIR__ . '/../vendor/autoload.php'
);
$pathToAutoloadFileNotFound = true;
$pathToAutoloadFile = null;

foreach (
$possiblePathsToComposerAutoloadFile as $path) {
    if (
file_exists($path)) {
       
$pathToAutoloadFile = $path;
       
$pathToAutoloadFileNotFound = false;
        break;
    }
}

if (
$pathToAutoloadFileNotFound) {
    echo
'could not find composer autoload.php, no composer installed?' . PHP_EOL;
    exit(
1);
}

require_once
$pathToAutoloadFile;

$command = new \Net\Bazzline\Component\ApiDocumentBuilder\Command\Builder($argv);
$command->execute();


Details

Api Document Builder

Api document builder centralize api documentation generation and updating of existing projects. Use it as a cronjob to have the latest documentation in time. Available at packagist and openhub.net.

The versioneye status is: Dependency Status

Work Flow

  • iterating over collection of project paths
  • generates documentation using apigen
  • creates index.html
  • do a git pull and evaluates the output to check if there is work to do

Usage

./bin/net_bazzline_api_document_builder path/to/configuration.php

Example

mkdir -p net_bazzline/api_document_builder
cd net_bazzline/api_document_builder
git clone https://github.com/bazzline/api_document_builder/ .
./bin/net_bazzline_api_document_builder example/configuration.php
lynx example/output/index.html

History

  • upcomming * @todo * implement usage of template * add link to current / latest tag (<path>/latest-release) * example link: https://github.com/bazzline/php_component_database_file_storage/releases/tag/0.6.2 * add links for each tag/release * add optional link to "demo page" * refactor by using the process pipe component * refactor by using the requirement component * implement unit tests * make it dynamically * use diactoros * generate a index.php instead of a index.html * add htaccess * <url>/my_project should be callable and transform into a redirect (if exists) * easy up adding project * <add> <url to composer.json> * parse composer.json * easy up deleting project * <validate> * deletes all where response code is greater or equal 300 * add more documentation generators (beside apigen) * create factories * add "keep_cache" (boolean) value * implement cache and output cleanup (if project is moved or deleted etc.) * validate git pull return message * supporting multiple project tags
  • 1.3.0 - released at 23.10.2016 * releaxed dependency handling by using the asterix on the bug level version
  • 1.2.2 - released at 15.03.2016 * updated dependencies
  • 1.2.1 - released at 29.02.2016 * fixed broken image for version eye * updated dependency
  • 1.2.0 - released at 29.02.2016 * moved to psr-4 autoloading
  • 1.1.9 - released at 24.01.2016 * updated dependency
  • 1.1.8 - released at 18.12.2015 * updated dependency
  • 1.1.7 - released at 19.11.2015 * updated dependency
  • 1.1.6 - released at 14.11.2015 * updated dependency
  • 1.1.5 - released at 08.11.2015 * updated dependency
  • 1.1.4 - released at 25.09.2015 * updated dependency
  • 1.1.3 - released at 18.09.2015 * updated dependency
  • 1.1.2 - released at 13.09.2015 * updated dependency
  • 1.1.1 - released at 04.07.2015 * updated dependency
  • 1.1.0 * implemented feature request of issue/2 * see migration steps
  • 1.0.4 * fixed issue/1
  • 1.0.3 * implemented usage of progress bar component
  • 1.0.2 * added optional "tracking_snippet" support for configuration * made index.html valid
  • 1.0.1 * updated dependency
  • 1.0.0 * initial release

Final Words

Star it if you like it :-). Add issues if you need it. Pull patches if you enjoy it. Write a blog entry if you use it. Donate something if you love it :-].


  Files folder image Files  
File Role Description
Files folder imagebin (1 file)
Files folder imageconfiguration (1 file)
Files folder imageexample (3 files)
Files folder imagemigration (1 file)
Files folder imagesource (6 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  bin  
File Role Description
  Accessible without login Plain text file net_bazzline_api_document_builder Example Example script

  Files folder image Files  /  configuration  
File Role Description
  Accessible without login Plain text file locator.php Aux. Auxiliary script

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file configuration.php Aux. Auxiliary script
  Accessible without login HTML file layout.html Doc. Documentation
  Accessible without login HTML file project_view.html Doc. Documentation

  Files folder image Files  /  migration  
File Role Description
  Accessible without login Plain text file from_1.0.x_to_1.1.0.md Data Auxiliary data

  Files folder image Files  /  source  
File Role Description
Files folder imageBuilder (2 files)
Files folder imageCommand (2 files)
Files folder imageProcessPipe (1 file)
Files folder imageRequirement (1 file)
Files folder imageService (2 files)
Files folder imageTemplate (2 files)

  Files folder image Files  /  source  /  Builder  
File Role Description
  Plain text file Apigen.php Class Class source
  Plain text file BuilderInterface.php Class Class source

  Files folder image Files  /  source  /  Command  
File Role Description
  Plain text file Builder.php Class Class source
  Plain text file CleanDirectory.php Class Class source

  Files folder image Files  /  source  /  ProcessPipe  
File Role Description
  Plain text file CreateNewProjectInTheCache.php Class Class source

  Files folder image Files  /  source  /  Requirement  
File Role Description
  Plain text file CachedProjectHasChanges.php Class Class source

  Files folder image Files  /  source  /  Service  
File Role Description
  Plain text file ApplicationLocator.php Class Class source
  Plain text file InvalidArgumentException.php Class Class source

  Files folder image Files  /  source  /  Template  
File Role Description
  Accessible without login HTML file layout.html Doc. Documentation
  Accessible without login HTML file project_view.html Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%
Total:110
This week:1
All time:9,624
This week:560Up