PHP Classes

PHP Readme Helper: API documentation generator for README files

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 84 All time: 10,045 This week: 560Up
Version License PHP version Categories
php-readme-helper 1.0.0MIT/X Consortium ...7Tools, Project Management, Language, P..., P...
Description 

Author

This package can be used as an API documentation generator for README files.

It can scan a given directory to find class files or check a given class file to extract documentation about the class functions and variables.

The package can generate a new README file from a template file in Markdown format and returns it as a string.

Optionally it can restrict the generated documentation to a given list of class functions.

Innovation Award
PHP Programming Innovation award nominee
May 2020
Number 8
Many API developers produce documentation for their APIs in README files using the Markdown format.

This package can generate automatic documentation README files for APIs by extracting such documentations from API source files.

Manuel Lemos
Picture of Lars Moelleken
  Performance   Level  
Name: Lars Moelleken <contact>
Classes: 25 packages by
Country: Germany Germany
Age: 36
All time rank: 62140 in Germany Germany
Week rank: 47 Up2 in Germany Germany Up
Innovation award
Innovation award
Nominee: 11x

Winner: 1x

Example

<?php

require __DIR__ . '/../vendor/autoload.php';

$readmeGenerator = new \voku\PhpReadmeHelper\GenerateApi();

$readmeGenerator->hideTheFunctionIndex = true;

$readmeGenerator->templateMethod = <<<RAW
#### %name%
<a href="#voku-php-readme-class-methods">?</a>
%description%

**Parameters:**
%params%

**Return:**
%return%

--------
RAW;

$readmeText = ($readmeGenerator)->generate(
   
__DIR__ . '/../src/voku/PhpReadmeHelper/GenerateApi.php',
   
__DIR__ . '/docs/base.md'
);

file_put_contents(__DIR__ . '/../README.md', $readmeText);


Details

[//]: # (AUTO-GENERATED BY "PHP README Helper": base file -> docs/base.md) Build Status Coverage Status Codacy Badge Latest Stable Version Total Downloads License Donate to this project using Paypal Donate to this project using Patreon

? PHP README Helper

Helper to auto-generate the API documentation in your README file.

Example

(build/generate_docs.php)

$readmeGenerator = new \voku\PhpReadmeHelper\GenerateApi();

$readmeText = ($readmeGenerator)->generate(
    __DIR__ . '/../src/voku/PhpReadmeHelper/GenerateApi.php',
    __DIR__ . '/docs/base.md'
);

file_put_contents(__DIR__ . '/../README.md', $readmeText);

GenerateApi

<p id="voku-php-readme-class-methods"></p>

generate(string $codePath, string $baseDocFilePath, string[]|null $useClasses): string

<a href="#voku-php-readme-class-methods">?</a> This method can generate API documentation with types from php code into your README file.

Parameters: - string $codePath <p>Path to a file or a directory.</p> - string $baseDocFilePath <p>Path to your base file for the README.</p> - array<array-key, string>|null $useClasses <p>If used, you can specify to classes, you will use.</p>

Return: - string <p>Return a string with the generated README.</p>

Support

For support and donations please visit Github | Issues | PayPal | Patreon.

For status updates and release announcements please visit Releases | Twitter | Patreon.

For professional support please contact me.

Thanks

  • Thanks to GitHub (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc.
  • Thanks to IntelliJ as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
  • Thanks to Travis CI for being the most awesome, easiest continous integration tool out there!
  • Thanks to StyleCI for the simple but powerfull code style check.
  • Thanks to PHPStan && Psalm for really great Static analysis tools and for discover bugs in the code!

  Files folder image Files (25)  
File Role Description
Files folder image.github (3 files)
Files folder imagebuild (1 file, 1 directory)
Files folder imagesrc (1 directory)
Files folder imagetests (3 files, 1 directory)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .scrutinizer.yml Data Auxiliary data
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file circle.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.txt Doc. Documentation
Accessible without login Plain text file phpcs.php_cs Example Example script
Accessible without login Plain text file phpstan.neon Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file psalm.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (25)  /  .github  
File Role Description
  Accessible without login Plain text file CONTRIBUTING.md Data Auxiliary data
  Accessible without login Plain text file ISSUE_TEMPLATE.md Data Auxiliary data
  Accessible without login Plain text file PULL_REQUEST_TEMPLATE.md Data Auxiliary data

  Files folder image Files (25)  /  build  
File Role Description
Files folder imagedocs (1 file)
  Accessible without login Plain text file generate_docs.php Example Example script

  Files folder image Files (25)  /  build  /  docs  
File Role Description
  Accessible without login Plain text file base.md Data Auxiliary data

  Files folder image Files (25)  /  src  
File Role Description
Files folder imagevoku (1 directory)

  Files folder image Files (25)  /  src  /  voku  
File Role Description
Files folder imagePhpReadmeHelper (2 files, 1 directory)

  Files folder image Files (25)  /  src  /  voku  /  PhpReadmeHelper  
File Role Description
Files folder imageTemplate (1 file)
  Plain text file GenerateApi.php Class Class source
  Plain text file GenerateStringHelper.php Class Class source

  Files folder image Files (25)  /  src  /  voku  /  PhpReadmeHelper  /  Template  
File Role Description
  Plain text file TemplateFormatter.php Class Class source

  Files folder image Files (25)  /  tests  
File Role Description
Files folder imagefixtures (1 file)
  Accessible without login Plain text file bootstrap.php Aux. Auxiliary script
  Plain text file Dummy.php Class Class source
  Plain text file PhpDocHelperTest.php Class Class source

  Files folder image Files (25)  /  tests  /  fixtures  
File Role Description
  Accessible without login Plain text file base.md Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
Downloadphp-readme-helper-2020-05-15.zip 18KB
Downloadphp-readme-helper-2020-05-15.tar.gz 14KB
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
Simple PHP Code Parser Download .zip .tar.gz the code parser is needed to get the informations from the php files Required
 Version Control Unique User Downloads Download Rankings  
 100%
Total:84
This week:0
All time:10,045
This week:560Up