countdown icon indicating copy to clipboard operation
countdown copied to clipboard

[WIP] Python variant

Open coatless opened this issue 2 years ago • 0 comments

Close #42

Translates countdown() and countdown_style() over to Python.

Also includes a restriction so that language-specific CI runs only when files in r/ or python/ change.

We currently have:

Screenshot showing a demonstration of the example.ipynb with the two countdown methods

I'm not sure if there is an issue with how the HTMLDependency() is being registered; but, the countdown at the moment renders but is not clickable with .show() (I think this is the same as browsable()).

I pieced together the changes needed by looking at:

  • https://github.com/posit-dev/py-htmltools/blob/a3a98259ee4c5164763a6f70b86e531c13a5bcc1/tests/test_deps.py
  • https://github.com/posit-dev/py-htmltools/blob/a3a98259ee4c5164763a6f70b86e531c13a5bcc1/tests/test_html_document.py
  • https://github.com/posit-dev/py-htmltools/blob/a3a98259ee4c5164763a6f70b86e531c13a5bcc1/tests/test_tags.py

Some useful examples of py-htmltools are over on py-shiny's website:

  • Tags: https://shiny.posit.co/py/docs/ui-html.html
  • HTMLDependency: https://shiny.posit.co/py/docs/custom-component-one-off.html#the-output_tabulator-function

Note: Tags in shiny.ui are just re-exports from htmltools: https://github.com/posit-dev/py-shiny/blob/6f4bf63b85587c7de2712505dc65a91036ec34a1/shiny/ui/init.py#L327-L356

coatless avatar Feb 04 '24 11:02 coatless