-
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.
* Allow to choose prefix for chunk names issue #2 * Add new addins - Name current Rmd file - Name file chosen in a directory - Name chunks from a folder - issue #13 - Allow to use 'prefix' in the Addin for current file in relation to issue #2 * Update Rproj * Rebasing --------- Co-authored-by: statnmap <[email protected]>
- Loading branch information
1 parent
627b585
commit 16b692b
Showing
8 changed files
with
53 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,4 +59,4 @@ VignetteBuilder: | |
Encoding: UTF-8 | ||
Language: en-GB | ||
LazyData: true | ||
RoxygenNote: 7.2.3 | ||
RoxygenNote: 7.3.2 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Version: 1.0 | ||
ProjectId: 0a211baf-95cc-4ba1-a993-ce5368b7e03f | ||
|
||
RestoreWorkspace: No | ||
SaveWorkspace: No | ||
|
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