Markdown Download for Reporting

Hi everyone, my main aim is in addition to figures I creat with Streamlit, I want to include some calculations to put into reports. I am open to any suggestions.
I am planning to use markdowns. But note that:

  • My markdowns will include variables, i.e. f"The sum of {x} and {y} is {x+y}.
  • My markdowns will include equations $$ x +y $$

So, there are several possibilities that come to my mind:

  • Writing markdowns to bottom of streamlit pages and copying from there to word files. However, equations are not copied correctly.
    image
  • Creating markdown and allow user to download it as *md file. But, to be honest I don’t know how to do that. Also, downloading without converting to word would be useless and will put another step of pandoc.
  • Any other option?

Code Snippet:
Streamlit Snippets · Streamlit

I am not sure if I have understood the question correctly.

What exactly is the goal?
That the user can download a Markdown or Word or maybe PDF?
Which format exactly?

Regarding the Markdown file, I would possibly use a template library like jinja2.
Or just f-strings.

For other formats (Word, PDF) there are also various python libraries with which you can create them directly.

I chose using fstring and Landon. However, I am saving the file to user’s desktop. Is there an option to put a download button instead of directly saving to desktop?

Hi @Berk_Demir. There aren’t a official release of donwload button (or something like that) but you can use a workaround discussed at https://discuss.streamlit.io/t/how-to-download-file-in-streamlit/1806/73. I hope this can help you! :sunglasses: :grin: