#2968 closed enhancement (fixed)
Move REST API Handbook content to GitHub
Reported by: | rmccue | Owned by: | Otto42 |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Developer Hub | Keywords: | has-patch commit |
Cc: |
Description
Much like wp-cli, the REST API documentation would greatly benefit from being on GitHub, and using an open editing process.
I've adapted the existing code used to power the wp-cli commands reference on DevHub into a new generic plugin. The CLI code has been updated to use this, and new API code is added to move our handbook there too. Patch incoming momentarily.
Do not commit this yet. I want to maintain the syncing plugin on GitHub and either pull it in as an svn external instead, or sync it manually.
cc @danielbachhuber
Attachments (5)
Change History (27)
This ticket was mentioned in Slack in #core-restapi by rmccue. View the logs.
7 years ago
#2
@
7 years ago
2968.diff adds a new WPORG Markdown plugin that just provides the base class used by the CLI (commands) and REST API handbooks. It doesn't update the CLI Handbook proper to use it yet, since that has a bit more functionality, but it will. Will require the CLI Handbook's manifest to be updated though, since it's incompatible.
In the process of extracting this out, I added a few extra bits of functionality not in the existing classes:
- Updating existing pages - If an existing page is found, it will now update the source URL. This allows us to retrofit into existing Handbooks (like the REST API)
- Conditional updates - When fetching the Markdown source, it will store the ETag from the server, and send it back on the next request. GitHub will return a 304 response, allowing us to skip updates altogether.
- Simplified manifest - Removed the requirement for
title
andcmd_path
from the manifest.title
is pulled from Markdown anyway, andcmd_path
is redundant with the key already there. (This still correctly parses the CLI command manifest.)
Will also publish this to GitHub as a standalone plugin.
#3
@
7 years ago
Now available on GitHub: https://github.com/WP-API/markdown-sync
This ticket was mentioned in Slack in #core-restapi by rmccue. View the logs.
7 years ago
#5
@
7 years ago
Added 2968.2.diff which changes the following:
- Edit Links - Changes admin bar Edit link to point at GitHub, and adds an edit link after the page title for all users.
- Admin UI - Adds a message to editors who go to the page warning that content/title/slug are synced.
- No CLI Changes - I removed the CLI command reference changes here, so we can ship for the API handbook without being blocked on compatibility. That said, I still have the changes ready, and it'd be great to switch both (and also the regular CLI handbook) eventually.
I'm personally happy to ship this ASAP, since we want to keep making content changes, and I want to avoid a messy reimport to Markdown (which I did by hand).
@kadamwhite Are you happy for us to switch over? If so, let's wrangle a meta-committer and get this thing shipped.
#6
@
7 years ago
2968.3.diff allows Markdown inside shortcodes. This is handy for things like [alert]
, and also works around https://github.com/Automattic/jetpack/issues/7535
This ticket was mentioned in Slack in #core-restapi by rmccue. View the logs.
7 years ago
This ticket was mentioned in Slack in #core-restapi by rmccue. View the logs.
7 years ago
This ticket was mentioned in Slack in #core-restapi by rmccue. View the logs.
7 years ago
This ticket was mentioned in Slack in #core-restapi by rmccue. View the logs.
7 years ago
#13
@
7 years ago
When this patch is applied the plugin will not be active yet (because it's being added), and if the plugin is not active then we get an error Class 'WordPressdotorg\Markdown\Importer' not found
. Should we have a defensive check around this?
#14
@
7 years ago
Should we have a defensive check around this?
Makes sense to me! I'll update the patch with this.
#15
@
7 years ago
Patch applies cleanly, works as advertised, and this would be a huge win. +1 from me!
This ticket was mentioned in Slack in #meta-devhub by rmccue. View the logs.
7 years ago
This ticket was mentioned in Slack in #meta by rmccue. View the logs.
7 years ago
This ticket was mentioned in Slack in #meta by rmccue. View the logs.
7 years ago
#21
@
7 years ago
- Owner set to Otto42
- Resolution set to fixed
- Status changed from new to closed
In 5993:
Add WPORG Markdown plugin for CLI/API handbooks