internetarchive / openlibrary

One webpage for every book ever published!
https://openlibrary.org
GNU Affero General Public License v3.0
5.08k stars 1.32k forks source link

Develop Tag Plugin System: Enhance Subjects page by Integrating Tags #8279

Open mekarpeles opened 1 year ago

mekarpeles commented 1 year ago

Once the basic ability to CRUD (create, read, update, delete) Tags has been achieved in #7766 and basic infrastructure is in place to connect/associate subject strings and Tags, the next step is to create a generic schema / DSL (domain specific language) for Tags that lets librarians define metadata to enhance how the subject page renders.

@JaydenTeoh has drafted/prototyped a plugins idea in #7928 that lets librarians associate Tags with any number of plugins (which are ostensibly macros or templates). #7928 is an amazing proof of concept, which achieves the goal of extending the capabilities of subject pages by defining a list of plugins which the subject page integrates. The concept is close but I think we may want to abstract as much of the implementation/code logic out of the Tag document and into the subject page (as a means of defining an implementation of the relationships specified within the Tag).

At minimum, we want to be able to (a) add more named carousels to Subject pages and (b) present patrons with a few librarian-chosen facets (related_tags or related_subjects) -- similar to the search page -- that the patron can click on to narrow their search.

This issue has 3 parts, all of which are prototyped by #7928:

image

image

Notes

Screenshot 2023-09-18 at 3 28 45 PM
mekarpeles commented 10 months ago

8466

mekarpeles commented 10 months ago

I think once we land #8466 we'll be in great shape to discuss next steps.

jimchamp commented 1 month ago

https://github.com/internetarchive/openlibrary/labels/State%3A%20Blocked on approach. It's unclear how these plugins will be used when rendering these new subject pages. Will the page be composed entirely of the plugins that are on the Tag? Or, are the plugins meant to be rendered in a specific section of the subject page?

For now, subject Tags will include a body field, which will contain an HTML string for rendering the new subject page. A separate issue will be created to track this work.