Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
After living for more than a year on GitHub, we are pleased to announce that the {remedy} package is now on CRAN.
A package for easier Markdown writing
About {remedy}
Good news, we’ve got the cure! {remedy} is a package designed to facilitate writing markdown documents in RStudio. The idea is to provide a series of keyboard shortcuts that will make you more efficient with markdown.
In other words, this package brings to markdown a “word processor like” experience when it comes to formatting — that is to say that putting things in bold is now possible via a keyboard shortcut.
Here is a quick example:
Available shorcuts
Here is a list of available shortcuts:
align_arrow/align_equalalign the assignment operators in the highlighted text.backtickrtakes a piece of text an put it between backticks.boldr/italicsr/strikerput a piece of text in bold, italics, or strike.chunkr/chunknamer/chunkr_doc/chunkr_section/chunksplitr, addins to deal with chunks.footnotercreates a footnote.h1r:h6rset selected text to headers (from H1 to H6).htmlcommentradd comment tags.imager/urlr/youtubertake an url and set the appropriate html/markdown tags.latexradd LaTeX tags.listr/olistrturn a series of lines into lists.rightrcopies selected content to the right.tablergenerates a markdown table.xaringanrinserts a pull-left pull-right for{xaringan}.
Setting up
Installing
You can install {remedy} from the CRAN or from GitHub:
# From CRAN
install.packages("remedy")
# From GitHub
remotes::install_github("ThinkR-open/remedy")
Note that once installed, you don’t need to launch the package to use the shortcuts.
Keyboard shortcuts
Of course, the idea is not to select the text, go to your addins list, search for the good addin, and to do perform the transformation: you need to bind the content of {remedy} to keyboard shortcuts.
If ever you want to do that, you can do this manually through Tools > Modify Keyboard Shortcuts.
You can also use the {rsam} package — either with the recommended shortcuts:
remedy::remedy_opts$get('hotkeys')
#> backtick bold chunk
#> "Ctrl+Cmd+`" "Ctrl+Cmd+B" "Ctrl+Alt+Cmd+C"
#> chunksplit chunkname footnote
#> "Ctrl+Shift+Alt+C" "Ctrl+Shift+Alt+N" "Ctrl+Cmd+Shift+6"
#> h1 h2 h3
#> "Ctrl+Cmd+1" "Ctrl+Cmd+2" "Ctrl+Cmd+3"
#> h4 h5 h6
#> "Ctrl+Cmd+4" "Ctrl+Cmd+5" "Ctrl+Cmd+6"
#> htmlcomment image italics
#> "Ctrl+Alt+C" "Ctrl+Cmd+P" "Ctrl+Cmd+I"
#> latex list right
#> "Ctrl+Cmd+L" "Ctrl+Shift+Cmd+=" "Alt+Cmd+Right"
#> strike table url
#> "Ctrl+Cmd+S" "Ctrl+Cmd+T" "Ctrl+Cmd+U"
#> xaringan youtube
#> "Ctrl+Cmd+X" "Ctrl+Cmd+Y"
hotkeys <- remedy::remedy_opts$get("hotkeys")
rsam::set_shortcut(sprintf('remedy::%sr',names(hotkeys)), hotkeys)
or with your own shortcuts.
Feedback and enhancement
You’ve found a bug, or have an enhancement idea? Feel free to open an
issue : https://github.com/ThinkR-open/remedy/issues.
The post {remedy} is now on CRAN appeared first on (en) The R Task Force.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
