jupyterlite-sphinx
jupyterlite-sphinx copied to clipboard
validate/parse example_class (and height)
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
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.