icat.utils#

Utility functions that are needed in multiple places.

Functions

add_highlights(text, regex[, color])

Adds HTML span tag highlights around any matches in the text for the given regex.

jupyter_lab_detected()

Return True if we recognize we're in a Jupyter Lab instance, as opposed to Jupyter Notebook.

jupyter_notebook_detected()

Return True if we recognize we're in a Jupyter Notebook instance, as opposed to Jupyter Lab.

populate_anchor_from_dictionary(anchor, ...)

Assign anchor's parameters from a dictionary containing the key value pairs.

vue_template_path(filename)

Get the path to the package "data resource" that is the requested vue template file.