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

validate/parse example_class (and height) #130

Open
Carreau opened this issue Jan 31, 2024 · 1 comment
Open

validate/parse example_class (and height) #130

Carreau opened this issue Jan 31, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Carreau
Copy link
Collaborator

Carreau commented Jan 31, 2024

I think it would be good to validate early the config options example_class, and height, mostly to fail early.

I'm thinking that it's easy for someone not knowing css to do thing like include a space, or a dot (.), which will most likely make the ccs wonky. I guess it is also good to protect against ay character that might break the HTML, like slashes/backslashes and angle bracket. I again doubt they would be but there on purpose, but one never know.

Validating classname should be straitforward, but Validating height is I think a bit more complicated as there are way more valus that can be taken, including things using calc() and expressions: https://developer.mozilla.org/en-US/docs/Web/CSS/height

@Carreau Carreau added the enhancement New feature or request label Jan 31, 2024
@steppi
Copy link
Collaborator

steppi commented Jan 31, 2024

This could be useful in some cases but I don't think it's that important for TryExamplesDirective. I think most users should use autodoc with global_enable_try_examples = True, and not bother with adding the directives manually. In any case, I think all of the jupyterlite-sphinx directives have a height option and haven't had this kind of validation. I don't think it's worth going through the trouble honestly.

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

No branches or pull requests

2 participants