Search by

davereid / drupal-gitlab-api-docs

Dave Reid

Generates API docs for a Drupal module's MkDocs site with phpDocumentor, including Hooks and Events pages.

Package info

github.com/davereid/drupal-gitlab-api-docs

pkg:composer/davereid/drupal-gitlab-api-docs

Statistics

Installs: 42

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 4

1.0.0 2026-11-23 00:20 UTC

This package is auto-updated.

Last update: 2026-12-01 08:12:57 UTC


README

Generates API reference pages for a Drupal module's MkDocs site from its PHP code, with phpDocumentor and the phpdocumentor-markdown template. It works with Zensical too: it fixes the Markdown itself and needs no MkDocs plugins or hooks.

  • docs/api/: a page for each class, trait and interface, titled with its name, and an index.
  • docs/hooks.md: the hooks from the module's *.api.php files, when it has some.
  • docs/events.md: the event names, the constants of classes named Events or *Events, with their docblocks, when it has some.

Usage

composer require --dev davereid/drupal-gitlab-api-docs

Add a docs script to the module's composer.json, with each path to document:

"scripts": {
    "docs": "drupal-gitlab-api-docs -d src -d mymodule.api.php"
}

Run composer run docs from the module's root. It reads the module's name from its *.info.yml file and passes other options to phpdoc. Add /docs/api, /docs/hooks.md, /docs/events.md and /.phpdoc to .gitignore: the pages are generated, never committed.

Agent skill

skills/setup-docs sets up a drupal.org project's docs site, including these API docs and the GitLab CI jobs that build them. Install it with npx skills add davereid/drupal-gitlab-api-docs.