Skip to content

Make try examples button more prominent#2705

Merged
aliabd merged 3 commits into
mainfrom
aliabd/better-examples-view
Nov 23, 2022
Merged

Make try examples button more prominent#2705
aliabd merged 3 commits into
mainfrom
aliabd/better-examples-view

Conversation

@aliabd
Copy link
Copy Markdown
Contributor

@aliabd aliabd commented Nov 22, 2022

We've gotten feedback from several users that the Try Examples website in the docs is easy to miss. So I've made it more prominent.

  • If the object has an 'Example Usage' section, there will be a button under it named 'More Examples'
  • If the object doesn't have an 'Example Usage' section, there will be a greyed out div of the first demo's code with the button overlayed on top.

Feedback on styling and wording welcome. To see this just checkout the branch and run sh scripts/launch_website.sh

Screen.Recording.2022-11-22.at.3.04.39.PM.mov

@github-actions
Copy link
Copy Markdown
Contributor

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-2705-all-demos

@aliabd aliabd requested a review from abidlabs November 22, 2022 23:15
@lewtun
Copy link
Copy Markdown

lewtun commented Nov 23, 2022

This looks wonderful @aliabd!

Not related to this PR, but I think having an "Example Usage" section for most components would go a long way towards making the docs more intuitive / accessible (kind of how every model in transformers has a little example you can copy-paste and play with)

@aliabd
Copy link
Copy Markdown
Contributor Author

aliabd commented Nov 23, 2022

Agreed @lewtun, we support that already on the website side, now just need to add it to the docstrings for the components that don't have it. Will get that in

@aliabd aliabd merged commit a433933 into main Nov 23, 2022
@aliabd aliabd deleted the aliabd/better-examples-view branch November 23, 2022 18:38
@abidlabs
Copy link
Copy Markdown
Member

Very nice @aliabd!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants