Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#5266 closed defect (bug) (fixed)

Source Block Editor docs from master branch

Reported by: mkaz's profile mkaz Owned by: coffee2code's profile coffee2code
Milestone: Priority: normal
Component: Developer Hub Keywords:


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)

5266.patch (992 bytes) - added by mkaz 4 years ago.

Download all attachments as: .zip

Change History (5)

4 years ago

#1 @coffee2code
4 years ago

  • Owner set to coffee2code
  • Resolution set to fixed
  • Status changed from new to closed

In 9963:

Developer theme: Revert to once again importing Block Editor handbook from master branch.

Props mkaz.
See #5020.
Fixes #5266.

#2 @coffee2code
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 @mkaz
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:$SLUG/
+               $tags = array(
+                       array(
+                               'slug' => '5.4',
+                               'tag'  => 'wp/5.4',
+                       ),
+               );
+               foreach ( $tags as $t ) {
+                       parent::do_init(
+                               'blocks',
+                               "block-editor-${t['slug']}",
+                               "${t['tag']}/docs/manifest.json"
+                       );
+               }

So WP 5.4 would be published to:

We'd need to create an array with the versions in the theme and add the switcher the user could toggle.


This ticket was mentioned in Slack in #core-editor by mkaz. View the logs.

4 years ago

Note: See TracTickets for help on using tickets.