Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ThinkR-open/remedy

RStudio Addins to Simplify Markdown Writing
https://github.com/ThinkR-open/remedy

hacktoberfest

Last synced: 3 months ago
JSON representation

RStudio Addins to Simplify Markdown Writing

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, echo=FALSE, results=FALSE}
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)
}
```

[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/remedy)](https://cran.r-project.org/package=remedy)
[![](http://cranlogs.r-pkg.org/badges/remedy)](https://cran.r-project.org/package=remedy)[![Travis-CI Build Status](https://travis-ci.org/ThinkR-open/remedy.svg?branch=master)](https://travis-ci.org/ThinkR-open/remedy)[![Coverage status](https://codecov.io/gh/ThinkR-open/remedy/branch/master/graph/badge.svg)](https://codecov.io/github/ThinkR-open/remedy?branch=master)[![Covrpage Summary](https://img.shields.io/badge/covrpage-Last_Build_2018_12_21-brightgreen.svg)](http://tinyurl.com/y76olv3v)

# remedy

`{remedy}` provides addins to facilitate writing in markdown with RStudio.

![](reference/figures/remedy_example.gif)

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.

## Install

```{r, eval = FALSE}
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.

## Using `{remedy}`

Write quicker in markdown with `{remedy}`!
Read the full manual in the associated {pkgdown} website:

Here's a list of all available helpers:

![](reference/figures/remedy_example.gif)

You can also have an overview of how the functions behave with the `remedy_example()` function:

```{r eval = FALSE}
library(remedy)
remedy_example( c("Never gonna", "give you up", "let you down"), listr )
```

### Align

Align selected blocks to their assignment operator, either `<-`

![](reference/figures/align.gif)

or `=`

![](reference/figures/alignequal.gif)

### Backtick

Enclose the selected word(s) in backticks.

![](reference/figures/backtick.gif)

### Blockquote

Turn selected line(s) to blockquote.

![](reference/figures/blockquote.gif)

### Chunk

Turn the selected text into a chunk.

![](reference/figures/chunk.gif)

> Note that every chunk is given a name.

chunksplit split the chunk at a given spot.

![](reference/figures/chunksplit.gif)

### Cross references

ID, table and figure cross-reference

![](reference/figures/cross-ref.gif)

### Emphasize

Embolden, italicize or strikethrough the selected text.

![](reference/figures/emphasise.gif)

### Footnotes

Turn the given text into a footnote.

![](reference/figures/footnote.gif)

### Headers

Turn the selected text into a header.

![](reference/figures/header.gif)

### HTML Comment

Turn the text into an html comment

![](reference/figures/htmlcomment.gif)

### Image

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.

![](reference/figures/image.gif)

### LaTeX

LaTeX syntax :

![](reference/figures/latex.gif)

### List

Turn the selected text into an unordered list.

![](reference/figures/list.gif)

### Moving

#### On the right

Copy the selected text or the current line to the right.

![](reference/figures/right.gif)

### Table

Insert a table inside your doc.

There are basically two way to do that with remedy :

#### Ttable

![](reference/figures/table.gif)

#### Parse your data

Turn your dataframe into a markdown table :

![](reference/figures/table_remedy.gif)

### URL

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.

![](reference/figures/url.gif)

### Youtube

Turn an url into a youtube embed:

![](reference/figures/youtube.gif)

### xaringan

Insert a xaringan pull-left and pull-right template.

![](reference/figures/xaringan.gif)

## Recommended shortcuts (macOS)

Here's a list of recommended shortcuts:

```{r}
remedy::remedy_opts$get('hotkeys')
```

### Managing Shortcuts

Use the [`{rsam}`](https://github.com/yonicd/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=)`.

```{r, eval = FALSE}
hotkeys <- remedy::remedy_opts$get("hotkeys")
rsam::set_shortcut(sprintf('remedy::%sr',names(hotkeys)), hotkeys)
```

## 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](https://github.com/ThinkR-open/remedy/issues).

## Code of conduct

Please note that the 'remedy' project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.