-
Notifications
You must be signed in to change notification settings - Fork 3
Prototype a listing plugin to use where we display structured data and files in our docs #41
Description
We have a number of places where we use something like a listing plugin, ie, we take structured data and render it in a few standard ways. I think it'd be a helpful way to prototype and dogfood if we tried making a "listing plugin" that we re-use in these use-cases.
- Tables from files
- Tables from YML metadata
- Table of available plugins through .yml file #25
- authors page in our team compass
- Galleries of cards from YML metadata
- The Jupyter Book gallery
- Tables from github issue searches and project boards (this one is probably not critical for now)
- The roadmap page on our website
Implementation
It feels like there are roughly three major steps. I wonder if we could make each of these extensible in a lightweight way:
- Load: Load data into a structured array of entries with standardized key/value pairs. E.g., load from YAML, load from glob + YAML metadata parsing. Future: load from function calls (e.g. github issues downloads)
- Transform: Modify the structured array in various ways. For example, add a new column using the values of other columns for each entry, to be parsed as MyST.
- Render: Convert a structured array into a structured output of MyST AST entries. For example, a list of cards with list entries populating the title/body/etc based on user configuration, a table output that just mirrors one or more columns from the structured array, or a simpler "list" style output for a more minimal style.
Ideally, we could implement the logic in three separable modules, with an easy/simple way to extend each one either by future improvements to this plugin, or by a plugin author that wanted to use the functionality of this plugin to create a new one (e.g. register a new type of Load function, and then just re-use the rest of the listing logic).
I don't think this would be too hard to implement here, but if it got really beefy or complex it might be worth having in a separate repo.
References
- Might be inspiration for a "core" listing plugin of some sort: Vews of content / document listings based on page metadata (e.g. for blogs, site navigation, etc) mystmd#840