2017 © Pedro Peláez
 

library apd

Simple PHP api documentation generator

image

zobaken/apd

Simple PHP api documentation generator

  • Sunday, February 12, 2017
  • by zobaken
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Simple PHP API documentation generator

What is this?

This is a simple library that helps to create api documentation directly in PHP code comment blocks., (*1)

Installation

You are required to use composer:, (*2)

composer require zobaken/apd ~0.3

Usage

To get parsed structure:, (*3)

use Apd\Parser;
...
$parser = new Parser();
$parser->path('path to your php files');
$endpoints = $parser->parse();

In result $endpoints will contain an array of \Apd\Structure\Endpoint., (*4)

Command line

This parser can be used generate simple Markdown or HTML output:, (*5)

php vendor/bin/apd-markdown.php path-to-files > output.md
php vendor/bin/apd-html.php path-to-files > output.html

Syntax

Optional description can be placed after any tag., (*6)

Project

@project <shortname> <version> <Title> 

Section

@section <Section-name> <Section title> 

Call entry

@call <Method> <Path> <Title> 

Request parameter

@request <Type> <Name> <Title> 

If parameter is optional then append |null to its type, like string|null., (*7)

If type is object then a list of nested fields can be included:, (*8)

@request object data Request object
int id User id
string email User email

Response field

@response <Type> <Name> <Title> 

Register object

You can define an object and use it later then. See example below., (*9)

Example

This is a simple example., (*10)

/**
 * @project test 1.0 Test project
 *
 * Project description.
 *
 * @section profile Register and login section
 *
 * Section description.
 *
 * @register Profile User profile object
 * int id User id
 * string email User email
 * string|null about About user
 * string|null profile_image Profile image
 * object|null address { User address
 *   string city City
 *   string street Street
 *   string number House number
 * }
 *
 * Registered class description.
 *
 */

/**
 * @call PUT /profile/register Register a new user
 *
 * Call entry description
 *
 * @request string token Security token
 * @request object profile Profile fields
 * string email User email
 * string password User password
 * string about="To be filled" About user
 * string profile_image=http://someserver/default.png About user

 * @response Profile data User profile
 */

The Versions

12/02 2017

dev-master

9999999-dev

Simple PHP api documentation generator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nikolay Neizvesny

api php generator documentation html

12/02 2017

0.2

0.2.0.0

Simple PHP api documentation generator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nikolay Neizvesny

api php generator documentation html

12/02 2017

0.1

0.1.0.0

Simple PHP api documentation generator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nikolay Neizvesny

api php generator documentation html