-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
54 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
name_chunks_addin <- function(){ | ||
name_chunks_file_addin <- function(){ | ||
name_chunks(path = rstudioapi::selectFile(filter = "R Markdown Files (*.Rmd)")) | ||
} | ||
|
||
name_chunks_addin <- function(){ | ||
prefix <- rstudioapi::showPrompt(title = "Chunk names prefix", | ||
message = "Leave empty to use filename (Default)", default = "") | ||
if (prefix == "") { | ||
name_chunks(path = rstudioapi::getActiveDocumentContext()$path) | ||
} else { | ||
name_chunks(path = rstudioapi::getActiveDocumentContext()$path, prefix = prefix) | ||
} | ||
} | ||
|
||
name_chunks_directory_addin <- function(){ | ||
namer::name_dir_chunks(rstudioapi::selectDirectory()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
Name: Label Rmd Chunks | ||
Name: Label Current Rmd Chunks | ||
Description: labels unnamed chunk of the active R Markdown document, based on the filename. | ||
Binding: name_chunks_addin | ||
Interactive: false | ||
|
||
Name: Label Rmd Chunks from File | ||
Description: labels unnamed chunk of a chosen R Markdown document, based on the filename. | ||
Binding: name_chunks_file_addin | ||
Interactive: true | ||
|
||
Name: Label Rmd Chunks from Directory | ||
Description: labels unnamed chunks of all R Markdown document in a Directory. | ||
Binding: name_chunks_directory_addin | ||
Interactive: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#' @param prefix prefix to use to name chunks. Default to cleaned name of the Rmd. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters