holoviz-topics / examples

Visualization-focused examples of using HoloViz for specific topics
https://examples.holoviz.org
Creative Commons Attribution 4.0 International
82 stars 24 forks source link

Handle the notebook title and metadata header #221

Closed maximlt closed 7 months ago

maximlt commented 1 year ago

Each page of the gallery is built 1) by adding a heading from the notebook's name (can be normalized), 2) by adding links to download or execute the project in a deployment, and 3) by embedding the full notebook content. If the full notebook includes a title, the page will then have two titles. For instance:

image

As it should be possible for users to download and execute the notebooks, it makes sense for them to have a title. Solutions include:

jbednar commented 1 year ago

I believe there are already issues discussing this topic, either in this repo or in nbsite's repo. Indeed, those are the main options that make sense, and I favor the second one, but don't know how to achieve it. There's also a third option, to put the download link at the very top, but use formatting so that it makes sense to be above the title (e.g. italics or some other formatting that makes it clearly "meta", i.e. about the page, rather than part of the content of the page).

maximlt commented 1 year ago

The other HoloViz galleries (Panel, HoloViews, etc.) are built from notebooks that do not have a title, it's added part of the build process.

Your third option is interesting and could work well for this website.

Ultimately this is about the conversation we are meant to have about how to handle the examples across HoloViz. I just wanted to record this issue as it doesn't look so good on some pages here, and projects have a name in their anaconda-project.yml file, which makes it different from the other galleries.

maximlt commented 1 year ago

The more I think about it the more I like your third option. The only difficulty that we may have is Sphinx complaining about a page not starting with a section title. If it does, we could just ignore it.

I was thinking more about it as this could also be leveraged to display the projects metadata. Last year some metadata was added at the beginning of most notebooks:

image

The info in there is a little redundant with what is declared in the project:

Last updated is only in the notebook, it's not in the project config, but it's something we could of course add in there and actually easily generate automatically.

My suggestion would be to have the source of truth for the metadata be the project config only (the anaconda-project.yml). We could then leverage that metadata to create a header that would be displayed above the notebook title on the website, displayed however we like. Having that information in the project means that it could be leveraged more easily to improve the gallery page. Streamlit for instance displays the authors list:

image

(In a very fancy world, the gallery items could be sorted by their Last updated date.)

I can see two drawbacks to this:

@jbednar let me know what you think about that.

jbednar commented 1 year ago

Wow, that sounds great! I'm not too concerned about people who download the notebook locally; it's fine for only the website to show the metadata, and for downloaded users to see it only if they look at the anaconda-project.yml. So I'd vote against injecting into the README or the notebook, to keep things simple!

maximlt commented 7 months ago

This has been implemented.