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

Move Optimization Detective docs into README.md #1763

Merged
merged 10 commits into from
Jan 9, 2025
Merged

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented Dec 19, 2024

After the most recent release of Optimization Detective, I discovered that the plugin directory has a 2,500 word limit for readme.txt files. And Optimization Detective now exceeds the limit:

image

This is resulting in the readme being truncated:

image

So this PR moves the Background, Technical Foundation, Use Cases/Examples, and Hooks into a README.md which is then linked to from the readme.txt. The initial two paragraphs of the plugin description are retained in both places for context. Sections are also added for installation, feedback, support, contributing, and security. There is also a new section added for extension plugins.

This also further improves the OD-related plugin readmes with a notice that the REST API must be available to unauthenticated visitors. See #1731.

@westonruter westonruter added [Type] Documentation Documentation to be added or enhanced no milestone PRs that do not have a defined milestone for release [Plugin] Optimization Detective Issues for the Optimization Detective plugin labels Dec 19, 2024
Copy link

github-actions bot commented Dec 19, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: westonruter <[email protected]>
Co-authored-by: swissspidy <[email protected]>
Co-authored-by: felixarntz <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@westonruter
Copy link
Member Author

westonruter commented Dec 19, 2024

  • The formatting of the accepted arguments to each action/filter could be added and improved.

@westonruter
Copy link
Member Author

westonruter commented Dec 19, 2024

Also good to add, although not necessary immediately:

  • How to write an extension
  • Class reference
  • Function reference
  • JSON Schema
  • Remove access private from anything exposed by filters or hooks
  • Extract hooks docs from PHPDoc?

@felixarntz
Copy link
Member

Maybe we should add a dedicated docs folder, or a Wiki, or something like that? The documentation needs for OD would probably justify a dedicated location like that.

@westonruter
Copy link
Member Author

I thought about a Wiki too, but @joemcgill suggested a README due to it being easier to keep up to date in code (as changes can land with new features in PRs). At the same time, edits are also burdensome since they have to go through the PR process. In any case, I think a README as a landing page makes sense and then we can break out sections into separate docs pages, whether that be in a docs subdirectory or a Wiki (which we'd have to enable for the repo, but then why not use the Handbook?)

@felixarntz
Copy link
Member

@westonruter

I thought about a Wiki too, but @joemcgill suggested a README due to it being easier to keep up to date in code (as changes can land with new features in PRs). At the same time, edits are also burdensome since they have to go through the PR process. In any case, I think a README as a landing page makes sense and then we can break out sections into separate docs pages, whether that be in a docs subdirectory or a Wiki (which we'd have to enable for the repo, but then why not use the Handbook?)

I think a docs folder works best, for the reasons you're saying, because it's part of the repo. +1 on linking to it from the README.md (and readme.txt). The constraints of using README.md make it difficult to overview as all the documentation is by definition on one long page. And with readme.txt also containing (some of) the documentation, there's a lot of duplication. So moving it all to a docs folder and linking to it improves the situation in various aspects.

@westonruter
Copy link
Member Author

@felixarntz How about this now? The docs are split into three files, with the README serving as the index and location for introductory information and small sections, with then separate docs containing docs for extensions and hooks:

  1. https://github.com/WordPress/performance/blob/update/od-readme/plugins/optimization-detective/README.md
  2. https://github.com/WordPress/performance/blob/update/od-readme/plugins/optimization-detective/docs/extensions.md
  3. https://github.com/WordPress/performance/blob/update/od-readme/plugins/optimization-detective/docs/hooks.md

@@ -0,0 +1,84 @@
# [Optimization Detective](https://wordpress.org/plugins/optimization-detective/)
Copy link
Member

Choose a reason for hiding this comment

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

I don't it's necessary to have this file act as a second version of a readme (next to readme.txt). There is still some duplication here, and I don't see why that's useful.

I think it would be better to trim this down to purely the documentation bits (e.g. change the title to something like "Plugin overview" or "Plugin introduction") and then move the file to e.g. docs/introduction.md.

On a related note, it might be helpful to create a docs/README.md file that acts as a table of contents for the available documentation files. You could then also add a "Back" link to each individual article file in docs, to simplify navigation.

Copy link
Member Author

Copy link
Member

@felixarntz felixarntz 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 the updates @westonruter!

@westonruter westonruter merged commit 6340f0c into trunk Jan 9, 2025
6 checks passed
@westonruter westonruter deleted the update/od-readme branch January 9, 2025 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no milestone PRs that do not have a defined milestone for release [Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Documentation Documentation to be added or enhanced
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants