Skip to content

Conversation

@iamdharmesh
Copy link
Member

Description of the Change

PR replace the existing hookdoc package with the WP Hooks Documentor package which is used for generate developer docs. The new package is uses the docusaurus and provide good flexibility on extending docs site.

screencapture-localhost-3000-distributor-2025-09-12-16_26_09

Note

The Distributor's yellow color is a bit light for the light theme, so I used a slightly darker shade here. Please let me know if we should use a different color instead. Dark mode looks fine, no changes there.

Closes #1336

How to test the Change

  1. Run npm i && npm run build:docs
  2. Run cd ./docs-build && npm run serve
  3. Visit http://localhost:3000/distributor to check generated doc site.

Changelog Entry

Developer - Replaced hookdoc with WP Hooks Documentor

Credits

Props @jeffpaul, @iamdharmesh

Checklist:

@iamdharmesh iamdharmesh self-assigned this Sep 12, 2025
@iamdharmesh iamdharmesh requested review from a team and jeffpaul as code owners September 12, 2025 11:49
@github-actions github-actions bot added this to the 2.3.0 milestone Sep 12, 2025
@github-actions github-actions bot added the needs:code-review This requires code review. label Sep 12, 2025
Copy link
Collaborator

@dkotter dkotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good here but I agree on the note around the yellow color.

This is very hard to read and I expect does not pass color contrast accessibility. This color works on the Distributor site because we only use it when the background is black. But on a white background, you can barely read the yellow text.

There's a few approaches I could see here:

  1. Only have the dark mode theme and don't allow switching to light mode. That matches how our plugin site looks so may be fine
  2. Anywhere we have yellow text, ensure the background is dark. This would be similar to always forcing dark mode but would still retain some lighter elements
  3. (easiest option probably) Don't use that yellow color for text if the text is on a light background. Not sure what color to replace it with though, could just always use black but not as fun visually then

Open to other suggestions / opinions on this though, cc @jeffpaul

@iamdharmesh
Copy link
Member Author

iamdharmesh commented Sep 12, 2025

I deployed this on my fork repo here: https://iamdharmesh.github.io/distributor/ to get feedback on color in light mode.

cc: @jeffpaul

@dkotter
Copy link
Collaborator

dkotter commented Sep 12, 2025

@iamdharmesh One other thing we'll need to take care of here that I just realized we missed in ClassifAI is to update any existing links within our code that points to the old documentation site. I know there's some in the changelog and looks like some in the documentation itself

Copy link
Collaborator

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, in addition to the accessibility issues I've got a couple of notes:

  • defined in lines in the source section, eg on this page:
    • would it be possible to link to the permalink rather than trunk, eg https://github.com/10up/distributor/blob/[commit-hash]/includes/utils.php#L318
    • would it be possible to highlight the start of the docblock through to the apply_filters|do_actions, eg https://github.com/10up/distributor/blob/4831cdcc01ac23f32f28b5bb51c683a610d7c34c/includes/utils.php#L311-L322

Comment on lines +63 to +65
<a href="https://github.com/10up/distributor/issues/">
Support
</a>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of reads as a donation request as is.

Suggested change
<a href="https://github.com/10up/distributor/issues/">
Support
</a>
<a href="https://github.com/10up/distributor/issues/">
Issues
</a>

Comment on lines +113 to +114
target="_blank"
rel="noopener nofollow noreferrer"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target=_blank is really bad for accessibility, let's give users the choice.

Suggested change
target="_blank"
rel="noopener nofollow noreferrer"

🔢 Applies to the other social links too.

Comment on lines +111 to +112
title="10up on Facebook"
aria-hidden="true"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment these don't appear in the accessibility tree (checked with firefox dev tools)

Suggested change
title="10up on Facebook"
aria-hidden="true"
aria-label="10up on Facebook"

🔢 Applies to the other social links too

@github-actions github-actions bot added the needs:refresh This requires a refreshed PR to resolve. label Nov 14, 2025
@github-actions
Copy link

@iamdharmesh thanks for the PR! Could you please rebase your PR on top of the latest changes in the base branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:code-review This requires code review. needs:refresh This requires a refreshed PR to resolve.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace hookdoc with WP Hooks Documentor

3 participants