posit-dev / py-shiny

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

send_custom_message API reference example isn't working #308

Open Polkas opened 2 years ago

Polkas commented 2 years ago

send_custom_message method in shiny.Session is not work properly. I tested it locally and confirm that with the native pyshiny docs as has the same problem. Please check out the example: https://shiny.rstudio.com/py/api/reference/shiny.Session.send_custom_message.html#shiny.Session.send_custom_message

cpsievert commented 2 years ago

I can confirm that the API reference example is broken, but I just tested shiny run shiny/examples/send_custom_message/app.py (as of e969764085e9800b9b9df65a7f87bad157e255c5) as well as:

cd shiny/examples
shiny static send_custom_message static 
python3 -m http.server --directory static 8008 

And everything seems to work as intended, so I think the issue might be specific to the API reference

wch commented 2 years ago

It looks like the the only difference between the API reference example, and version in shiny/examples/send_custom_message/app.py is that the selector is "" instead of "<p>". I'm guessing this has to do with escaping when the API docs are generated. (Related to #163, #164)