Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the Hooks Documentation in the Wiki #86

Merged
merged 2 commits into from
Mar 16, 2024
Merged

Conversation

akirk
Copy link
Owner

@akirk akirk commented Mar 16, 2024

This adds a script that extracts the hooks offered by the Enable Mastodon Apps plugin and writes to the Enable Mastodon Apps Wiki Hooks Documentation.

This is a screenshot of the mastodon_api_account page.

Screenshot 2024-03-16 at 06 16 52

Adding Hook Documentation

In this PR you can also see how hooks can be documented:

Add a comment block before the apply_filters or do_action function call. The first line will be the text displayed in the hooks list:

Screenshot 2024-03-16 at 06 21 50

Other lines appear on the documentation page (Example: mastodon_api_account).

Add example code by writing:

* Example:
* ```php
* apply_filters( 'hook_name', function ( $params ) {
*    // modify params
*    return $params;
* } );
* ```

Extraction process

  • Create the wiki directory by running git clone git@github.com:akirk/enable-mastodon-apps.wiki.git.
  • Run php bin/extract-hooks.php script via CLI.
  • Change into the enable-mastodon-apps.wiki directory and observe the new or changed files.
  • git commit and git push the changes.
  • Visit the wiki to inspect the updates.

@akirk akirk requested a review from pfefferle March 16, 2024 05:25
@akirk akirk marked this pull request as ready for review March 16, 2024 05:26
@akirk akirk merged commit 4f76837 into main Mar 16, 2024
38 checks passed
@akirk akirk deleted the add-hooks-documentation branch March 16, 2024 05:31
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.

1 participant