jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
192 stars 62 forks source link

Views and lists of content based on page metadata (e.g. for blogs, galleries, site navigation, etc) #840

Open agoose77 opened 8 months ago

agoose77 commented 8 months ago

Proposal

There are many cases where somebody wants to display views of subsets of content and data. For example:

To first order, a blog could be considered as a dynamic view over appropriately annotated documents. If we add support for additional metadata, such as tags, and the ability to select and render subtrees according to these tags, then we could implement basic blog support. We might also want to be able to specify the authoring date.

The blog theme would benefit from a filter / home view that previews the various subdocuments. We'd be interested in getting this working for 2i2c's blog, and later this might bear fruit for The Turing Way's "Pathway" mechanism.

Inspiration

agoose77 commented 7 months ago

c.f. https://github.com/orgs/executablebooks/discussions/1128

choldgraf commented 5 months ago

In my mind, blogging is a special case of "show a list of site content that is filtered and/or sorted by page metadata values". So I think there are two nested issues here:

  1. Provide support for "dynamic views of a site's content based on page metadata". e.g., give authors the ability to render content views like "show me all the pages in my MyST site that have valueX for fieldY in the page's metadata. (or valueX > N or whatever). This could be used for many usecases, for example the Turing Way use-case of "give users different lists of pages based on user persona".
  2. Use this functionality to implement blogging functionality. This might special-case some fields (e.g. define a folder that tracks blog posts in myst.yml) and include the extra things that are unique to blogs (like RSS feeds or links to external posts for cross-posting purposes).

I'm separating these out in-part because I think that use-cases like the ones described in the issue below could also be served by this functionality:

Once you created the ability to "give me a list of pages based on their metadata", you could extend that to something like a "notebook sharing gallery" that could show a gallery of MyST content (each backed by a notebook) where the metadata used for filtering was something like "uses dataset X/Y/Z".

choldgraf commented 5 months ago

I just realized that this is very similar to the dataviews plugin for obsidian, so I added a link there in the top comment

https://blacksmithgu.github.io/obsidian-dataview/