WordPress.org

Making WordPress.org

Opened 4 months ago

Closed 3 months ago

Last modified 3 months ago

#5266 closed defect (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)

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

Download all attachments as: .zip

Change History (5)

@mkaz
4 months ago

#1 @coffee2code
3 months 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
3 months 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
3 months 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?

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


3 months ago

Note: See TracTickets for help on using tickets.