Skip to content

Add option for initial warning cell in try examples directive - #143

Merged
Carreau merged 4 commits into
jupyterlite:mainfrom
steppi:warning
Mar 7, 2024
Merged

Add option for initial warning cell in try examples directive#143
Carreau merged 4 commits into
jupyterlite:mainfrom
steppi:warning

Conversation

@steppi

@steppi steppi commented Feb 29, 2024

Copy link
Copy Markdown
Collaborator

Closes #142

This PR updates the code for auto generating the notebooks to have the option to add an initial "warning" cell like discussed in #142. This has been added as a configuration option both at the individual directive level, and at the global level with option try_examples_global_warning_text, similar to the existing try_examples_global_button_text etc.

I just looked the json for one of Scikit-Learn's notebooks and copied that formatting there. Basically, wrapping the text supplied in the config with a <div class='alert alert-warning'>. Jupyter is apparently has some css that's aware of this formatting and styles things appropriately.

@steppi steppi added the enhancement New feature or request label Feb 29, 2024
Comment thread jupyterlite_sphinx/_try_examples.py Outdated
Co-authored-by: M Bussonnier <bussonniermatthias@gmail.com>
@steppi

steppi commented Mar 1, 2024

Copy link
Copy Markdown
Collaborator Author

Thanks @Carreau. Yes, that should definitely be keyword only.

@steppi

steppi commented Mar 1, 2024

Copy link
Copy Markdown
Collaborator Author

I've rebuilt the SciPy docs at https::/steppi.github.io/scipy against this branch. See https://steppi.github.io/scipy/reference/generated/scipy.integrate.quad.html#scipy.integrate.quad for a specific example.

@Carreau

Carreau commented Mar 7, 2024

Copy link
Copy Markdown
Collaborator

Let's get that in. Thanks !

@Carreau
Carreau merged commit 0ef8be2 into jupyterlite:main Mar 7, 2024
@steppi

steppi commented Mar 7, 2024

Copy link
Copy Markdown
Collaborator Author

Thanks @Carreau!

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option for warning in first cell of TryExamples generated notebook

2 participants