Share on Social Media

You can create share buttons for social media. This is based on the code I found at https://sharingbuttons.io/, which after a couple of hours of googling turned out to be the simplest way to share the content. Kudos to creator. It has some minor modifications, but it’s mostly a wrapping of the code for stremlit.

It requires as arguments the message and the url.

share(my_text, my_url)

This function takes a url and a text and displays clickable sharing buttons in html.

Parameters:
  • my_text (str) – the text to share on social media

  • my_url (str) – the url to share on social media