Skip to content

Commit

Permalink
feat(snippets): Add a Shiny Express app snippet (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: Joe Cheng <[email protected]>
  • Loading branch information
gadenbuie and jcheng5 authored Apr 26, 2024
1 parent c924d50 commit fda783b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- The extension now supports Shiny for R apps. (#30)
- The [Python VS Code extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) is now a soft dependency and is no longer installed by default with the Shiny for VS Code extension. (#30)
- Added a new setting, `shiny.previewType`, to control where the Shiny app preview should be opened. (#40)
- Added a new `shinyexpress` snippet to quickly create a basic Shiny Express app in Python. (#42)

## 0.1.6

Expand Down
20 changes: 18 additions & 2 deletions snippets/shiny.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,23 @@
"app = App(app_ui, server)",
""
],
"description": "Basic Shiny app skeleton"
"description": "Basic Shiny Core app skeleton"
},
"Shiny Express application": {
"scope": "python",
"prefix": "shinyexpress",
"body": [
"from shiny.express import input, render, ui",
"",
"ui.input_slider(\"n\", \"N\", 0, 100, 20)",
"",
"",
"@render.text",
"def txt():",
"\treturn f\"n*2 is {input.n() * 2}\"",
""
],
"description": "Basic Shiny Express app skeleton"
},
"Shiny module": {
"scope": "python",
Expand Down Expand Up @@ -93,4 +109,4 @@
"}"
]
}
}
}

0 comments on commit fda783b

Please sign in to comment.