0

This is another try for my other post Shiny hyperlink relative path to a file :

In brief, I want to create a hyperlink on my shiny web page which when clicked should open a new HTML page with the content created in server.R file.

Here is a sample code that I tried but didn't work ( NOT FOUND error in chrome ):

 library(shiny); 
 shinyApp( ui = fluidPage(a("readme",href=htmlOutput("readme"),target="_blank")), 
      server = function(input, output) {
        output$readme<-renderUI({
          htmlcontent <- tags$html( tags$head( tags$title('Content of README.txt')),
                                    tags$body(p(system("cat README.txt",intern=TRUE)))
                                    )
          return(htmlcontent)  
        })  
      })

README.txt is in the same location as this application on the linux server.

Any help?

Community
  • 1
  • 1
Sri
  • 1,130
  • 1
  • 15
  • 31
  • You can do something like this. I have answered a questions relating the password implementation (not my idea), you can see it here, but I would go answering your question the same way: http://stackoverflow.com/questions/28987622/starting-shiny-app-after-password-input/28997605#28997605. Also in your href you should inlcude target="_blank" – Pork Chop Jul 13 '15 at 15:29
  • It still gives me the same error, I changed the code to look like : ui2 <- function(){tagList(tabPanel("Test"))} shinyApp( ui = fluidPage(a("readme",href=htmlOutput("readme"),target="_blank")), server = function(input, output) {output$page <- renderUI({ div(class="outer",do.call(navbarPage,c(inverse=TRUE,title = "Contratulations you got in!",ui2()))) }) }) – Sri Jul 13 '15 at 15:54

0 Answers0