Skip to content

Commit b82eff1

Browse files
committed
:octocat: +phpdoc
1 parent 4007033 commit b82eff1

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

.github/workflows/ci.yml

+27
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,33 @@ jobs:
4141
- name: "Run phan"
4242
run: php vendor/bin/phan
4343

44+
build-docs:
45+
name: "Build and publish Docs"
46+
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- name: "Checkout sources"
51+
uses: actions/checkout@v2
52+
53+
- name: "Install PHP"
54+
uses: shivammathur/setup-php@v2
55+
with:
56+
php-version: "7.4"
57+
coverage: none
58+
tools: phpDocumentor
59+
extensions: gd, imagick, json, mbstring
60+
61+
- name: "Build Docs"
62+
run: phpdoc --config=phpdoc.xml
63+
64+
- name: "Publish Docs to gh-pages"
65+
uses: JamesIves/[email protected]
66+
with:
67+
BRANCH: gh-pages
68+
FOLDER: docs
69+
CLEAN: true
70+
4471
tests:
4572
name: "Unit Tests"
4673

docs/Readme.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Auto generated API documentation
2+
3+
The API documentation can be auto generated with [phpDocumentor](https://www.phpdoc.org/).
4+
There is an [online version available](https://chillerlan.github.io/php-database/) via the [gh-pages branch](https://github.com/chillerlan/php-database/tree/gh-pages) that is [automatically deployed](https://github.com/chillerlan/php-database/deployments) on each push to main.
5+
6+
Locally created docs will appear in this directory. If you'd like to create local docs, please follow these steps:
7+
8+
- [download phpDocumentor](https://github.com/phpDocumentor/phpDocumentor/releases) v3+ as .phar archive
9+
- run it in the repository root directory:
10+
- on Windows `c:\path\to\php.exe c:\path\to\phpDocumentor.phar --config=phpdoc.xml`
11+
- on Linux just `php /path/to/phpDocumentor.phar --config=phpdoc.xml`
12+
- open [index.html](./index.html) in a browser
13+
- profit!

phpdoc.xml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<phpdoc>
3+
<parser>
4+
<target>docs</target>
5+
<encoding>utf8</encoding>
6+
<markers>
7+
<item>TODO</item>
8+
</markers>
9+
</parser>
10+
<transformer>
11+
<target>docs</target>
12+
</transformer>
13+
<files>
14+
<directory>src</directory>
15+
<directory>tests</directory>
16+
</files>
17+
<transformations>
18+
<template name="responsive-twig"/>
19+
</transformations>
20+
</phpdoc>

0 commit comments

Comments
 (0)