-
Notifications
You must be signed in to change notification settings - Fork 34
/
README.Rmd
227 lines (127 loc) · 5.75 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{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)
}
```
<!-- badges: start -->
[![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)
<!-- badges: end -->
<img src="https://raw.githubusercontent.com/ThinkR-open/remedy/master/reference/figures/thinkr-hex-remedy.png" width=250px>
# 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: <https://thinkr-open.github.io/remedy/>
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=<NEW_SETTINGS>)`.
```{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.