jupyterlab-contrib / jupyterlab-tour

A JupyterLab UI tour built on jupyterlab-tutorial and react-joyride.
BSD 3-Clause "New" or "Revised" License
61 stars 9 forks source link

XPath selector #21

Open fcollonval opened 3 years ago

fcollonval commented 3 years ago

These last three kinda quack like "middleware," which could be registered by plugins and opted into in a tour definition in the settings/command API... As these would not be part of the official types, they'd need a new place in the schema, e.g. "extras" or "transformers," e.g. {"markdown": true, "xpath": true, "commands": true} at the simplest, though they might need configuration...

Originally posted by @bollwyvl in https://github.com/jupyterlab-contrib/jupyterlab-tour/issues/17#issuecomment-836613650

fcollonval commented 3 years ago

Xref: https://developer.mozilla.org/en-US/docs/Web/API/Document/evaluate

bollwyvl commented 3 years ago

Thanks for adding this. Also, a quick thing most browsers implement (but is not a safe API to rely on):

$x(`//some/long/xpath[with=quotes()`)

Anyhow... this might be a non-starter, as the target cannot be a callback... and there's little guarantee that e.g. the Run button element would exist before opening a notebook. Might have to cool this one and go upstream on this one...