knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" ) # Copy reference/images to man/images # reference folder is required to work with pkgdown if (!dir.exists("man/figures")) {dir.create("man/figures")} file.copy(list.files("reference/figures", full.names = TRUE), "man/figures", overwrite = TRUE) if (dir.exists("docs")) { file.copy("reference/figures/thinkr-hex-remedy-favicon.ico", "docs/favicon.ico", overwrite = TRUE) }
{remedy}
provides addins to facilitate writing in markdown with RStudio.
All the functions are meant to be mapped to keyboard shortcuts. A list of suggested shortcuts is provided towards the end of this README.
Note that most of the addins/shortcuts below will also work without selecting any text.
remotes::install_github("ThinkR-open/remedy")
Once you've installed the package, you don't need to load it with library()
, the addins are installed on your machine as part of the package install process.
{remedy}
Write quicker in markdown with {remedy}
!
Read the full manual in the associated {pkgdown} website: https://thinkr-open.github.io/remedy/
Here's a list of all available helpers:
You can also have an overview of how the functions behave with the remedy_example()
function:
library(remedy) remedy_example( c("Never gonna", "give you up", "let you down"), listr )
Align selected blocks to their assignment operator, either <-
or =
Enclose the selected word(s) in backticks.
Turn selected line(s) to blockquote.
Turn the selected text into a chunk.
Note that every chunk is given a name.
chunksplit split the chunk at a given spot.
ID, table and figure cross-reference
Embolden, italicize or strikethrough the selected text.
Turn the given text into a footnote.
Turn the selected text into a header.
Turn the text into an html comment
Turn the selected path into an image.
This element is context aware: if you select a text and a link, it turns the text into title between ![]
, and puts the link between ()
.
If the last element of the selection is not a link, you get an error message straight into you markdown document.
LaTeX syntax :
Turn the selected text into an unordered list.
Copy the selected text or the current line to the right.
Insert a table inside your doc.
There are basically two way to do that with remedy :
Turn your dataframe into a markdown table :
Turn the selected text into a link.
This element is context aware: if you select a text and a link, it turns the text into title between []
, and puts the link between ()
.
If the last element of the selection is not a link, you get an error message straight into you markdown document.
Turn an url into a youtube embed:
Insert a xaringan pull-left and pull-right template.
Here's a list of recommended shortcuts:
remedy::remedy_opts$get('hotkeys')
Use the {rsam}
package to set and manage for you the hotkey settings of {remedy}
.
If you want to edit the default settings you can view the defaults remedy_opts$get('hotkeys')
and change them through remedy_opts$set(hotkeys=<NEW_SETTINGS>)
.
hotkeys <- remedy::remedy_opts$get("hotkeys") rsam::set_shortcut(sprintf('remedy::%sr',names(hotkeys)), hotkeys)
You've found a bug, or have an enhancement idea? Feel free to open an issue : https://github.com/ThinkR-open/remedy/issues.
Please note that the 'remedy' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.