Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Generate Documentation

on:
release:
types: [published]

jobs:
generate-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout release code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: dom, curl, libxml, mbstring, zip

- name: Download Doctum
run: |
wget -q https://doctum.long-term.support/releases/latest/doctum.phar
chmod +x doctum.phar

- name: Switch to api-docs branch
run: |
git checkout api-docs || git checkout -b api-docs
git reset --hard ${{ github.sha }}

- name: Generate documentation
run: |
./doctum.phar update doctum.php -v

- name: Commit and push documentation
run: |
git config --local user.email "[email protected]"
git config --local user.name "Fieldmanager Docs"
git add docs/
if git diff --staged --quiet; then
echo "No documentation changes to commit"
else
git commit -m "Update API documentation for ${{ github.event.release.tag_name }}"
git push origin api-docs
fi
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ Thumbs.db
*.code-workspace
.idea
.vscode

# Created by Apigen for logs
build/
.claude

# Built docs
docs/
cache/
doctum.phar

# Code coverage report
report/
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ Development of Fieldmanager happens on [GitHub](http://github.com/alleyinteracti

## Generating Documentation

To build Fieldmanager's API documentation, the latest version of which is available at [api.fieldmanager.org](https://api.fieldmanager.org), you need [apigen](https://github.com/ApiGen/ApiGen) installed. Once you've got that, you can generate the entire documentation tree as follows:
[Fieldmanager's API documentation](https://api.fieldmanager.org) is built using [Doctum](https://github.com/code-lts/doctum) and a GitHub Action. Docs are stored in the `api-docs` branch.

To build the docs manually, see the Doctum README for instructions on downloading the phar file, then you can generate the entire documentation tree by checking out the `api-docs` branch and running:

```bash
apigen -c apigen.neon
doctum.phar update doctum.php
```
19 changes: 0 additions & 19 deletions apigen.neon

This file was deleted.

23 changes: 0 additions & 23 deletions docs-src/templates/bootstrap/404.latte

This file was deleted.

59 changes: 0 additions & 59 deletions docs-src/templates/bootstrap/@elementlist.latte

This file was deleted.

180 changes: 0 additions & 180 deletions docs-src/templates/bootstrap/@layout.latte

This file was deleted.

Loading
Loading