Skip to content

Conversation

@jjroelofs
Copy link
Contributor

Summary

  • Adds content_intel.api.php following Drupal's standard API documentation convention
  • Documents the module's hook and plugin extension system

Closes #12

Changes

  • Documents hook_content_intel_info_alter() for modifying plugin definitions
  • Provides complete plugin creation guidelines with code examples
  • Lists all available plugin attribute parameters and interface methods

Test plan

  • Verify file follows Drupal coding standards
  • Verify hook documentation matches actual implementation in ContentIntelPluginManager
  • Verify code examples are syntactically correct

Jurriaan Roelofs added 3 commits January 29, 2026 09:26
Add developer documentation for the Content Intelligence module's
hook and plugin system, following Drupal's api.php convention.

Documents:
- hook_content_intel_info_alter() for modifying plugin definitions
- Plugin creation guidelines with code examples
- Available plugin attribute parameters and methods
Fix PHPCS warning for unused import.
Addresses DX improvements identified during API documentation review:

1. Add hook_content_intel_collect_alter()
   - Allows modules to modify collected intelligence data
   - Enables computed/derived metrics based on combined plugin data
   - Documented in content_intel.api.php with examples

2. Improve API documentation (content_intel.api.php)
   - Add dependency injection example for plugin development
   - Document the new collect alter hook
   - Reference example module for working code

3. Add content_intel_example submodule
   - WordCountPlugin: Basic plugin without external dependencies
   - EntityAgePlugin: Advanced plugin with dependency injection
   - Alter hook implementation demonstrating computed metrics
   - Comprehensive README with usage instructions

All changes pass local drupal-lint and drupal-check.
@jjroelofs jjroelofs merged commit 3b51574 into 1.x Jan 29, 2026
2 checks passed
@jjroelofs jjroelofs deleted the feature/add-api-documentation branch January 29, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add API documentation file (content_intel.api.php)

2 participants