jupyterlite-sphinx icon indicating copy to clipboard operation
jupyterlite-sphinx copied to clipboard

Hide buttons from `TryExamples` directive by default

Open agriyakhetarpal opened this issue 2 months ago • 4 comments

Description

This PR hides the buttons from the TryExamples directive by default. This is helpful because the current method of ignoring particular pages based on their URL first loads the buttons and then hides them, which means that they are briefly displayed on that page in the documentation and then hidden – keeping them hidden and then selectively enabling them will minimise this latency and improve user experience.

Changes made

  1. Made all try_examples_button buttons hidden at the time of generation by adding this keyword to the classList
  2. Updated the loadTryExamplesConfig function in jupyterlite_sphinx.js to check for the try_examples_button hidden class instead and then remove hidden from the classList

Additional context

N/A

agriyakhetarpal avatar May 01 '24 16:05 agriyakhetarpal