Interactive documentation in R with collaborative review capabilities

I’m working on a team project where we need to create documentation using R. We want our team to be able to review and discuss the content together. I’ve seen lots of examples of how to make book-style docs with Rmarkdown and cool interactive visuals with R-shiny. But I can’t seem to find a way to add comments like you can in Google Docs or Word.

I’m thinking it would be great to have a split screen setup. One side could show the main content (text, graphs, code) and the other side could be for comments. I know this would need some kind of server to store the comments.

Has anyone done something like this before? Any tips or tricks would be super helpful! Even if you know of a workaround or a partial solution, I’d love to hear about it.

Here’s a basic example of what I’m picturing:

library(shiny)

ui <- fluidPage(
  titlePanel("Team Doc Review"),
  splitLayout(
    mainPanel("Main content goes here"),
    sidebarPanel("Comments would go here")
  )
)

server <- function(input, output) {}

shinyApp(ui = ui, server = server)

But obviously, this doesn’t have the comment functionality yet. Any ideas on how to make this work?

While I haven’t implemented this exact setup, I can suggest a potential approach. You might want to look into combining Shiny with a database solution for storing comments. PostgreSQL or MongoDB could work well for this purpose. You’d need to set up server-side logic to handle comment storage and retrieval.

For the UI, consider using the ‘shinyjs’ package to dynamically add comment boxes. You could create a custom input widget for comments, allowing users to add, edit, and delete their feedback.

To enhance collaboration, you might also want to explore integrating authentication. This would allow you to track who made which comments and potentially implement user-specific features.

Remember to consider data security and backups when dealing with collaborative content. It’s crucial to ensure your team’s work is protected and recoverable.

This is a complex project, but it could greatly enhance your team’s workflow. Good luck with your implementation!

have u checked out bookdown? it’s not exactly what ur looking for, but it can do some cool stuff with R markdown. maybe u could use it as a starting point and add a comments section with javascript? just brainstorming here. good luck with ur project!

I’ve actually tackled a similar challenge before, and one solution that worked well for us was using RStudio Connect. It’s not free, but it offers some great collaboration features out of the box.

We set up our R Markdown documents on Connect, which allowed team members to view and interact with the content directly in their browsers. The killer feature for us was the built-in commenting system. You can highlight text or specific elements and add comments right there.

If RStudio Connect isn’t an option, you might want to look into using Git for version control and then integrating a tool like ReviewNB. It’s designed for Jupyter notebooks, but you can use it with R Markdown files too. It gives you that side-by-side diff view with inline commenting capabilities.

These solutions aren’t exactly what you described, but they might get you closer to your goal without having to build everything from scratch. Hope this helps!