Skip to content

Commit

Permalink
fix: separate r and python snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed May 3, 2024
1 parent 4fbeaa5 commit 5c519e5
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 38 deletions.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
"snippets": [
{
"language": "python",
"path": "./snippets/shiny.json"
"path": "./snippets/shiny-python.json"
},
{
"language": "r",
"path": "./snippets/shiny-r.json"
}
],
"commands": [
Expand Down
38 changes: 1 addition & 37 deletions snippets/shiny.json → snippets/shiny-python.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,41 +72,5 @@
"\t\treturn f\"Click count is {count()}\"",
""
]
},
"Shiny application (R)": {
"scope": "r",
"prefix": "shinyapp",
"body": [
"library(shiny)",
"library(bslib)",
"",
"ui <- page_${1:fluid}(",
" ${0}",
")",
"",
"server <- function(input, output, session) {",
"",
"}",
"",
"shinyApp(ui, server)"
]
},
"Shiny module (R)": {
"scope": "r",
"prefix": "shinymod",
"body": [
"${1:name}UI <- function(id) {",
" ns <- NS(id)",
" tagList(",
" ${0}",
" )",
"}",
"",
"${1:name}Server <- function(id) {",
" moduleServer(id, function(input, output, session) {",
" ",
" })",
"}"
]
}
}
}
38 changes: 38 additions & 0 deletions snippets/shiny-r.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"Shiny application (R)": {
"scope": "r",
"prefix": "shinyapp",
"body": [
"library(shiny)",
"library(bslib)",
"",
"ui <- page_${1:fluid}(",
" ${0}",
")",
"",
"server <- function(input, output, session) {",
"",
"}",
"",
"shinyApp(ui, server)"
]
},
"Shiny module (R)": {
"scope": "r",
"prefix": "shinymod",
"body": [
"${1:name}UI <- function(id) {",
" ns <- NS(id)",
" tagList(",
" ${0}",
" )",
"}",
"",
"${1:name}Server <- function(id) {",
" moduleServer(id, function(input, output, session) {",
" ",
" })",
"}"
]
}
}

0 comments on commit 5c519e5

Please sign in to comment.