jupyter-book / mystmd

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

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

Open agoose77 opened 10 months ago

agoose77 commented 10 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 9 months ago

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

choldgraf commented 8 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 7 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/

choldgraf commented 2 weeks ago

A hand-rolled blog for inspiration

I spent some time updating my blog to use the new myst engine. As part of this, I wrote a very basic Python plugin for MyST that parses source files in my blog and displays it as a list + RSS feed. I'll share links below in case it's helpful for any inspiration.

https://github.com/choldgraf/choldgraf.github.io/blob/main/src/blogpost.py

And here are two little posts about it:

https://chrisholdgraf.com/blog/2024/mystmd-with-the-blog https://chrisholdgraf.com/blog/2024/blog-list