posit-dev / great-tables

Make awesome display tables using Python.
https://posit-dev.github.io/great-tables/
MIT License
1.81k stars 60 forks source link

Add a formatting method that transforms URLs to links #80

Open rich-iannone opened 9 months ago

rich-iannone commented 9 months ago

For any cells containing URLs, we should have a fmt_url() method to make them navigable links. We should be careful to employ the method only on column containing URL text (though it is probably the user's responsibility to ensure this and that there are, for example, no URLs as part of a larger block of text).

We could expose options for how the links should be styled. They can be of the conventional style (with underlines and text coloring that sets it apart from other text), or, they can appear to be button-like (with a surrounding box that can be filled with a color).

URLs in data cells could be detected in two ways:

For the second case the URL is also used as the label but there is the option to use the label argument to modify that text.

kmasiello commented 5 months ago

Also include ability to format email addresses as address