Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

register package as RStudio addin to open current file with editR #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@ Version: 0.2.2
Date: 2015-10-11
Author: Simon Garnier <[email protected]>
Maintainer: Simon Garnier <[email protected]>
Description: editR is a basic Rmarkdown editor with instant previewing of your
document. It allows you to create and edit Rmarkdown documents while instantly
previewing the result of your writing and coding. It also allows you to render
your Rmarkdown file in any format permitted by the 'rmarkdown' package.
Description: editR is a basic Rmarkdown editor with instant previewing of your
document. It allows you to create and edit Rmarkdown documents while instantly
previewing the result of your writing and coding. It also allows you to render
your Rmarkdown file in any format permitted by the 'rmarkdown' package.
License: GPL (>= 3)
Imports: shiny (>= 0.11.1), shinyBS (>= 0.61), shinyAce (>= 0.2.1),
shinyFiles (>= 0.6.0), rmarkdown (>= 0.5.1), knitr (>= 1.9)
Imports:
shiny (>= 0.11.1),
shinyBS (>= 0.61),
shinyAce (>= 0.2.1),
shinyFiles (>= 0.6.0),
rmarkdown (>= 0.5.1),
knitr (>= 1.9),
rstudioapi
RoxygenNote: 5.0.1
12 changes: 12 additions & 0 deletions R/openCurrent.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#' Open current file with editR
#'
#' Open current file in editor with editR.
#'
#' @export
#'
openCurrent <- function(){
context <- rstudioapi::getActiveDocumentContext()
cat(paste0("Opening file ", context$path, " with editR"))
editR::editR(file = context$path)
}

4 changes: 4 additions & 0 deletions inst/rstudio/addins.dcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Name: editR - Open current file
Description: Open current file in editor with editR.
Binding: openCurrent
Interactive: false
2 changes: 1 addition & 1 deletion man/bs3_dialog.Rd

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

2 changes: 1 addition & 1 deletion man/bs3_dropdown.Rd

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

2 changes: 1 addition & 1 deletion man/bs3_navbar.Rd

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

19 changes: 10 additions & 9 deletions man/editR.Rd

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

12 changes: 12 additions & 0 deletions man/openCurrent.Rd

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

6 changes: 3 additions & 3 deletions man/preview.Rd

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