forked from catherinedevlin/ipython-sql
-
Notifications
You must be signed in to change notification settings - Fork 77
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
improvements to the display.py
module
#846
Comments
Acceptance Criteria
|
I forgot to mention something: let's update our developer docs as well, there is a section that talks about the display.py module so let's put some examples of this new API! |
Are you referring to this part? |
yes! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
we added a
display.py
module to centralize the way to show feedback to the user because we have to support two frontends: Jupyter (which supports displaying HTML) and the terminal (only supports plain text)the
Message
class allows creating an object that correctly displays its value in HTML if it's running in Jupyter or in plain text if running in the terminal, and it allows adding an optional CSS style (which is only visible in Jupyter).The limitation happens when we want to display a link in the message. this happens when we want to point users to certain sections in our docs: if we add the HTML link to a Message instance, it'll display correctly in Jupyter but it won't in the terminal.
We can do something like this:
then, internally, the plain text representation can resolve to:
and the HTML one to:
The text was updated successfully, but these errors were encountered: