Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tags for the example gallery? #16601

Open
NicolasHug opened this issue Feb 29, 2020 · 11 comments
Open

Tags for the example gallery? #16601

NicolasHug opened this issue Feb 29, 2020 · 11 comments

Comments

@NicolasHug
Copy link
Member

NicolasHug commented Feb 29, 2020

Just throwing out the idea...

We have lots of examples in the gallery. Some of them are beginner oriented like #15706, and some are much more advanced, like the ones proposed in #14300. It can be overwhelming for newcomers who don't necessarily know what they're looking at.

How would you feel about adding tags, e.g. "Beginner", "Advanced", "New in 0.XX" etc.? I'm picturing these as labels e.g. on the rendered image in the gallery, but we could also use them for filtering?

I guess this is not just scikit-learn related but also a sphinx-gallery feature, I'm just testing the water here first

@glemaitre
Copy link
Member

This looks like a great idea. I see also another pattern: "Usage" where we show basic usage, "Tutorial" which an end-to-end example. I thought that we should rework the indexing in the example landing page but I think your proposal would be the best first step (tags + filtering).

@jnothman
Copy link
Member

jnothman commented Mar 2, 2020 via email

@adrinjalali
Copy link
Member

Kinda related, I guess, is that I'm always lost when I try to find a specific example, or find something which would help. For instance, going to the GridSearchCV, there are tons of examples linked in the bottom, but most of them are not GridSearchCV tutorials really. I guess it would be nice if we could somehow group them better? Not sure.

@jnothman
Copy link
Member

jnothman commented Mar 2, 2020 via email

@adrinjalali
Copy link
Member

I think we can put everything which hasn't been annotated to belong to a category, in the "everything else" category, and put it after the ones we manually tag.

BTW, I do think the feature you've invented is way way better than not having it, and it's pretty okay in most cases. It gets confusing if a class is used in too many examples.

@GaelVaroquaux
Copy link
Member

A not too complicated (but imperfect) suggestion for reorganizing examples:

  • We could do 2 galleries (sphinx-gallery now supports multiple galleries):
    • "Tutorial examples", where we move the most didactic examples and expand them. Using "notebook style examples" enables to be very didactic
    • "Snippet examples" (don't know if it's a good name), where everything else goes.
  • We would put more focus on the "Tutorial examples" by:
    • Putting them more visible on the website
    • Having two backlink minigalleries at the bottom of API documentation, with the first one being examples from the tutorial examples, and the second one being snippets
  • Because this reorganization will break links (eg from Google), hence we should keep the same links for the "snippets", which will be most of the examples, and do redirect pages (possibly manually) for the tutorial examples that we move.

I think that the suggestion above would be an intermediate step that would still provide a tangible improvement.

@NicolasHug
Copy link
Member Author

I think that the suggestion above would be an intermediate step that would still provide a tangible improvement.

Agreed!

@lucyleeow
Copy link
Member

Possibly interesting/relevant here, a small package for adding tags to sphinx documentation: https://github.com/melissawm/sphinx-tags
I think there is no inherent, easy way to add tags in sphinx.

@glemaitre
Copy link
Member

@lucyleeow @jnothman proposed a POC long time ago: https://github.com/scikit-learn/scikit-learn/pull/17929/files

Indeed, we can use the rst_prolog where we define the tag in pure HTML and sphinx will replace it on the go.

It would avoid having an additional dependency in this case.

@lucyleeow
Copy link
Member

lucyleeow commented Jun 26, 2023

This is nice! I think the extra functionality that would be nice to add for example gallery tags is to be able to get a list of all examples with a specific tag, I guess similar to the filtering of parameters suggested as an extension (in #17929).

Agree that extra dependency is not ideal but it was also reference to see one way it could be done.

@glemaitre
Copy link
Member

If we want to have a better integration as you suggest, then having the dependency would be worth IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants