posit-dev / py-shiny

Shiny for Python
https://shiny.posit.co/py/
MIT License
1.32k stars 81 forks source link

Improve static content documentation #1760

Closed simon-smart88 closed 2 weeks ago

simon-smart88 commented 2 weeks ago

Currently the only information about how to serve static content is in https://shinylive.io/py/examples/#static-content which is overly complex and not the place I would expect to look. I was trying to add a static image to an app by asking shiny assistant and it had no idea about the requirement to add this which wasted loads of time:

www_dir = Path(__file__).parent / "www"
app = App(app_ui, server, static_assets = www_dir) 

It would be good if this was explained in https://shiny.posit.co/py/docs/ and if ui.img (and maybe ui.tags.iframe) could be included in the https://shiny.posit.co/py/api/ reference guide.

simon-smart88 commented 2 weeks ago

Ok now I see it is in https://shiny.posit.co/py/docs/ui-customize.html and this is the wrong repo anyway, so I'll close this