Skip to content

NEW (auto-generated) "hooks" developer docs#1135

Merged
mauteri merged 12 commits intoGatherPress:developfrom
carstingaxion:feature/extract-wp-hooks
Aug 4, 2025
Merged

NEW (auto-generated) "hooks" developer docs#1135
mauteri merged 12 commits intoGatherPress:developfrom
carstingaxion:feature/extract-wp-hooks

Conversation

@carstingaxion
Copy link
Copy Markdown
Collaborator

@carstingaxion carstingaxion commented Jul 27, 2025

Bildschirmaufzeichnung.vom.28.07.2025.01.47.10.webm

Description of the Change

Introduce akirk/extract-wp-hooks to the build-tools.


Closes #

How to test the Change

Changelog Entry

Added - New (auto-generated) "hooks" developer docs

Credits

Props @carstingaxion, @akirk

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@what-the-diff
Copy link
Copy Markdown

what-the-diff bot commented Jul 27, 2025

PR Summary

  • Introduction of Configuration File
    A new configuration file, .extract-wp-hooks.json, has been added. This file allows us to define the plugin namespace, set the documentation directory, specify the GitHub blob URL, and exclude certain directories.

  • Automated Workflow via GitHub Actions
    A new GitHub Actions workflow, .github/workflows/extract-wp-hooks-as-docs.yml, has been introduced. This workflow automates the process of extracting documentation for WordPress hooks whenever there are code changes pushed to the develop branch.

  • Detailed Documentation for Hooks
    A new file, Hooks.md, has been added. It contains detailed descriptions of various hooks used within GatherPress, including information about classes and filters.

  • Creation of Individual Hook Documentation files
    Detailed markdown files have been created for each hook. These files include:

    • gatherpress_autoloader.md
    • gatherpress_date_format.md
    • gatherpress_force_online_event_link.md
    • gatherpress_import.md
    • gatherpress_pseudopostmetas.md
    • gatherpress_roles.md
    • gatherpress_settings_section.md
    • gatherpress_sub_pages.md
    • gatherpress_text_after.md
    • gatherpress_time_format.md
    • gatherpress_timezone.md
  • Updated and Improved Documentation
    Existing documentation for class autoloader in class-autoloader.php has been updated with examples of using hooks. The pseudopostmetas documentation in class-migrate.php has been improved, showcasing more readable and well-formatted example syntax.

@mauteri
Copy link
Copy Markdown
Contributor

mauteri commented Jul 30, 2025

This is pretty awesome!

@carstingaxion
Copy link
Copy Markdown
Collaborator Author

I realised that the current workflow action is heavily bound to using the result as a GitHub wiki, which is not what GatherPress would need, so I wrote a custom action that relies on composer and takes care of committing, creating and pushing a PR with the updated hook docs. Similar to what the Screenshot action does.

Here is my test-runner: https://github.com/carstingaxion/gatherpress_extract-wp-hooks_workflow-test

This still has the same markdown formatting issues, mentioned by the linter, but this has a ticket now at: akirk/extract-wp-hooks#12

…like the default akirk/extract-wp-hooks GH action). This workflow creates commits to a new temp. branch, pushes the branch and creates a new PR containing the updated 'hook' docs.
@mauteri
Copy link
Copy Markdown
Contributor

mauteri commented Aug 2, 2025

@carstingaxion maybe for now we add a .markdownlintignore file with the hooks directory until this is updated and passes linting rules for @wordpress/scripts. What do you think?

@carstingaxion
Copy link
Copy Markdown
Collaborator Author

@carstingaxion maybe for now we add a .markdownlintignore file with the hooks directory until this is updated and passes linting rules for @wordpress/scripts. What do you think?

That was my first thought, too.
But I hopped for a cleaner solution, and I guess @akirk delivered that solution in one of his last contributions.

Let’s try that first, and go with the ignore file as a second option.
I’ll test this.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 4, 2025

Preview changes with Playground

You can preview the recent changes for PR#1135 with the following PHP versions:

PHP Version 8.3

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

@carstingaxion carstingaxion marked this pull request as ready for review August 4, 2025 10:56
@mauteri
Copy link
Copy Markdown
Contributor

mauteri commented Aug 4, 2025

@carstingaxion this ready for final review and merge?

@carstingaxion
Copy link
Copy Markdown
Collaborator Author

@carstingaxion this ready for final review and merge?

Yes, please @mauteri !

@mauteri mauteri merged commit d96cf62 into GatherPress:develop Aug 4, 2025
19 checks passed
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.

2 participants