Skip to content

Commit

Permalink
fixed example from readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dokato committed Nov 18, 2020
1 parent 5164d8d commit 16816b2
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 29 deletions.
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,27 @@ Example
Visit [examples](https://github.com/Appsilon/shiny.router/tree/master/examples) directory for some complete samples. Here's the basic usage:

```r
router <- make_router(
route("/", root_page),
route("/other", other_page)
)
library(shiny)
library(shiny.router)

ui <- fluidPage(
title = "Router demo",
router$ui
)
root_page <- div(h2("Root page"))
other_page <- div(h3("Other page"))

router <- make_router(
route("/", root_page),
route("other", other_page)
)

ui <- fluidPage(
title = "Router demo",
router$ui
)

server <- function(input, output, session) {
router$server(input, output, session)
}
server <- function(input, output, session) {
router$server(input, output, session)
}

shinyApp(ui, server)
shinyApp(ui, server)
```

How to contribute?
Expand Down
2 changes: 1 addition & 1 deletion docs/articles/basics.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 21 additions & 15 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pkgdown: 1.5.1
pkgdown_sha: ~
articles:
basics: basics.html
last_built: 2020-11-03T17:57Z
last_built: 2020-11-18T20:04Z

0 comments on commit 16816b2

Please sign in to comment.