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

Using multiple blueprint files (partials) #97

Open
flexseth opened this issue Mar 30, 2024 · 5 comments
Open

Using multiple blueprint files (partials) #97

flexseth opened this issue Mar 30, 2024 · 5 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@flexseth
Copy link

flexseth commented Mar 30, 2024

The blueprint.json files offer tremendous opportunity from a scaffolding and programmatic standpoint to developers using WordPress Playground. What if it were possible to chain together multiple blueprints to create an instance?

Use case: Build Playground docs for WordPress Plugin development

I want to see all documentation tagged plugin developer

User goes to documentation, searches "develop plugins with Playground" and finds a list of all the documentation that is tagged with plugin developer.

Docs: Creating a Plugin with WordPress Playground (post_title)
Steps: (post_content) - see below - raw .json
Description: Importing multiple WXR files to build a catalog of posts (post_excerpt)

Pseudocode

  • InstallTheme schoolyard
  • LoginStep
  • ImportWXR getting-started-with-plugin-development-in-playground.wxr
  • ImportWXR understanding-plugin-headers.wxr
  • ImportWXR plugin-activation-hooks.wxr
  • ImportWXR plugin-deactivation-hooks.wxr
  • ImportWXR plugin-uninstall-hooks.wxr
  • ImportWXR plugin-security-best-practices.wxr
  • ImportWXR plugin-translation-best-practices.wxr
  • ImportWXR plugin-licensing-best-practices.wxr
  • InstallPluginStep create-plugin
  • InstallPluginStep plugin-review-check.zip
  • InstallPluginStep plugin-security-check.zip
  • ActivatePluginStep create-plugin
  • ActivatePluginStep plugin-review-check
  • ActivatePluginStep plugin-security-check
  • ImportWXR submit-plugin-for-review.wxr
  • LandingPage /

Now the user will come to the Schoolyard theme, and see the documentation for creating a plugin with WordPress Playground, with Step by Step instructions for building a WordPress Plugin.

Limitations

ImportXWR isn't implemented

Currently ImportWXR does not exist as a step in the blueprint.json file. This step could be implemented simply with a WPCLIStep and import command, and link to a WXR file in the assets directory.

Blueprint parser extended

New functionality would have to be created to chain blueprint.json files.

Creating this Step would open the door to building out documentation based on user needs in lieu of having a bunch of extra docs. For example, a new user to WordPress does not need to understand how to run Playground through a web socket.

Conclusion

Being able to chain blueprints together would open up the ability to add "partial" blueprints, which could be used modularly to build out a Playground instance.

@flexseth flexseth added the enhancement New feature or request label Mar 30, 2024
@flexseth
Copy link
Author

Themer use case

Create multiple pages with multiple patterns, based on a list of patterns in JSON form

A web designer picks up a website running the TwentyTwentyThree theme, and doesn't want to overhaul it.

What they would like to do is use the existing media (images), and patterns for the TT3 theme, to see what kind of pages can be easily created. They want to install multiple new pages for "About", "Contact Us", and "Testimonials" - using built-in patterns for TT3.

Pseudocode

  • Import existing website (partial)
  • Generate About Us > (partial) - Create Page and Add tt3-about-us pattern template
  • Generate Contact Us > (partial) - Create Page and Add tt3-contact-us pattern template
  • Generate Testimonials > (partial) - Create Page and Add tt3-testimonials pattern template

They can then go and change the images to match what's available in the current media library, and update text.

Creating a very quick working demo of new pages for this client.

@flexseth flexseth added the documentation Improvements or additions to documentation label Mar 30, 2024
@flexseth
Copy link
Author

Previous discussion on using multiple blueprints

Let's find a declarative, portable, composable blueprint format

@flexseth
Copy link
Author

Blueprint Builder

This PR ships with
multiple
functions
geared
toward partial parsing of JSON stanzas

@adamziel
Copy link
Collaborator

adamziel commented Apr 2, 2024

Such a great issue @flexseth, thank you so much for fleshing this out! Since Blueprints are branching out as a separate library, I'll move this issue over to the https://github.com/WordPress/blueprints-library repo

Also there's a related, but more general and less fleshed out issue here #49. Let's keep both open as merging Blueprints and partial Blueprints could be two different use-cases.

@adamziel adamziel transferred this issue from WordPress/wordpress-playground Apr 2, 2024
@carstingaxion
Copy link

Me and probably other people from the GatherPress project would love see this being solved, too. Simply for DRY reasons.

Originally I just wanted to use a playground to create and export some demo content, while I ended up with a complete new repository, multiple new Issues/Ideas and a bunch of blueprint.json files to create different types of playgrounds for the GatherPress plugin. This was amazing 🚀-science against human-🛌-rules, but it was great! But not DRY, unfortunately.

https://github.com/carstingaxion/gatherpress-demo-data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants