#5266 closed defect (bug) (fixed)
Source Block Editor docs from master branch
Reported by: | mkaz | Owned by: | coffee2code |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Developer Hub | Keywords: | |
Cc: |
Description
The change of sourcing documentation from the stable WP tag has ended up causing more confusion than previous state. After some discussion in core editor, we want to switch it back and then figure out a version switcher.
I think doing something similar with the manifest is the right idea, if we can create an array of stable tag versions and then grab those docs and push to a unique location for each.
I'll see if I can figure out how with the script, but welcome any input if someone is more familiar with it.
For now I've attached a patch that reverts #5020
Attachments (1)
Change History (5)
#2
@
4 years ago
@mkaz: I'm not clear on what you have in mind for a version switcher. Where is the switch living, and what is it switching? Is this a release-time build switcher to select the branch of the docs to be presented in the handbook? Or are you talking about having multiple versions of the handbook being available at once and the user can switch which they want to see?
#3
@
4 years ago
@coffee2code : Thanks for taking care of that patch.
With regards to switcher, my idea is that multiple copies of the handbook would be published and the user could switch to the version they want.
I need to figure out how to setup an environment and test, but my idea for the code is something like this
+ // Generate a new handbook for each tag. + // The handbook will be published to: https://developer.wordpress.org/block-editor-$SLUG/ + $tags = array( + array( + 'slug' => '5.4', + 'tag' => 'wp/5.4', + ), + ); + + foreach ( $tags as $t ) { + parent::do_init( + 'blocks', + "block-editor-${t['slug']}", + "https://raw.githubusercontent.com/WordPress/gutenberg/${t['tag']}/docs/manifest.json" + ); + } +
So WP 5.4 would be published to: https://developer.wordpress.org/block-editor-5.4/
We'd need to create an array with the versions in the theme and add the switcher the user could toggle.
Thoughts?
In 9963: