GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - php-documentation-generator/php-documentation-generator: PDG: PHP Documentation Generator

BranchesTags
Open more actions menu

Latest commit

 

History

90 Commits
90 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
bin
bin
 
 
config
config
 
 
src
src
 
 
template
template
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.php-cs-fixer.dist.php
.php-cs-fixer.dist.php
 
 
.symfony-ignore
.symfony-ignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
box-phpunit.json.dist
box-phpunit.json.dist
 
 
box.json.dist
box.json.dist
 
 
cog.toml
cog.toml
 
 
composer.json
composer.json
 
 
phpstan.neon.dist
phpstan.neon.dist
 
 
phpunit.xml.dist
phpunit.xml.dist
 
 
phpunit.xml.dist.bak
phpunit.xml.dist.bak
 
 

Repository files navigation

PHP Documentation Generator

A PHP tool to generate a clean and structured documentation based on PHP documentation, and following Diátaxis documentation framework.

This tool was written for api-platform and is a work in progress.

Installation

With phar.io

phive install php-documentation-generator/php-documentation-generator

Using git

git clone [email protected]:php-documentation-generator/php-documentation-generator
cd php-documentation-generator
composer install

Usage

Reference

To create an API reference of a PHP source code directory:

PDG_AUTOLOAD=vendor/autoload.php ./bin/pdg references src docs

Or for a single PHP file:

PDG_AUTOLOAD=vendor/autoload.php ./bin/pdg reference src/Foo.php > Foo.mdx

Guides

To generate a guide from a PHP file use the bin/pdg guide command.

There's also an adapted version of phpunit to run a guide tests with bin/pdg-phpunit.

Configuration

Example of API Platform's configuration:

pdg:
    guides:
        base_url: '/docs/guide'
        output: '/data/docs/guides'
        src: './guides'
    references:
        base_url: '/docs/reference'
        exclude: ['*Factory.php', '*.tpl.php']
        exclude_path: ['JsonSchema/Tests', 'Metadata/Tests', 'OpenApi/Tests']
        namespace: 'ApiPlatform'
        output: '/data/docs/reference'
        src: '../src'
        tags_to_ignore: ['@experimental', '@internal']

Find also a programmatic usage on API Platform's website

Notes

This tool is not ready to be customized or used as-is and you'll need to code to adapt to your needs. The code architecture is based on extending Reflection with advanced types (read from php documentation) and Linking support. Feel free to reuse this nice basis to help with your documentation. Templates are written in old-school, hard to read PHP and only output MDX as needed for API Platform. We don't guarantee any backward compatibility release yet.

Compile phar

There are 2 binaries, pdg and pdg-phpunit:

./tools/box compile
gpg -u [email protected] --detach-sign --output bin/pdg.phar.asc bin/pdg.phar
./tools/box compile -c box-phpunit.json.dist
gpg -u [email protected] --detach-sign --output bin/pdg-phpunit.phar.asc bin/pdg-phpunit.phar

These need optimization imo.

About

PDG: PHP Documentation Generator

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

7 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.