Include sphinx-generated docs into streamlit app?


In my current app I want to link (and package) the sphinx-generated documentation for the project and make it accessible via a button or link at the bottom of the sidebar in the streamlit app.

A pop-over hovering over the app would be neat, but opening a new tab and showing the sphinx docs would also work for me.

Maybe I don’t see the obvious?

PS: Currently, the html files are created using tox.

has anyone done this?

Hi @cwerner -

There are some open issues for serving static content from a folder. At that point, you could link to the generated HTML pages and it would work:

In the meantime, you could read the HTML into a string (using the file open(..., 'r') built-in method), then use components.html to display the content. Depending on what you want to do with the content, there are various ways of hiding the content or optionally displaying the HTML.

1 Like