Giter Club home page Giter Club logo

remedy's Introduction

CRAN_Status_Badge Travis-CI Build StatusCoverage statusCovrpage Summary

remedy

{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.

Install

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:

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

Align selected blocks to their assignment operator, either <-

or =

Backtick

Enclose the selected word(s) in backticks.

Blockquote

Turn selected line(s) to blockquote.

Chunk

Turn the selected text into a chunk.

Note that every chunk is given a name.

chunksplit split the chunk at a given spot.

Cross references

ID, table and figure cross-reference

Emphasize

Embolden, italicize or strikethrough the selected text.

Footnotes

Turn the given text into a footnote.

Headers

Turn the selected text into a header.

HTML Comment

Turn the text into an html comment

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.

LaTeX

LaTeX syntax :

List

Turn the selected text into an unordered list.

Moving

On the right

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

Table

Insert a table inside your doc.

There are basically two way to do that with remedy :

Ttable

Parse your data

Turn your dataframe into a markdown table :

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.

Youtube

Turn an url into a youtube embed:

xaringan

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

Recommended shortcuts (macOS)

Here’s a list of recommended shortcuts:

remedy::remedy_opts$get('hotkeys')
#>           backtick               bold              chunk         chunksplit 
#>       "Ctrl+Cmd+`"       "Ctrl+Cmd+B"   "Ctrl+Alt+Cmd+C" "Ctrl+Shift+Alt+C" 
#>          chunkname           footnote                 h1                 h2 
#> "Ctrl+Shift+Alt+N" "Ctrl+Cmd+Shift+6"       "Ctrl+Cmd+1"       "Ctrl+Cmd+2" 
#>                 h3                 h4                 h5                 h6 
#>       "Ctrl+Cmd+3"       "Ctrl+Cmd+4"       "Ctrl+Cmd+5"       "Ctrl+Cmd+6" 
#>        htmlcomment              image            italics              latex 
#>       "Ctrl+Alt+C"       "Ctrl+Cmd+P"       "Ctrl+Cmd+I"       "Ctrl+Cmd+L" 
#>               list              right             strike              table 
#> "Ctrl+Shift+Cmd+="    "Alt+Cmd+Right"       "Ctrl+Cmd+S"       "Ctrl+Cmd+T" 
#>                url           xaringan            youtube 
#>       "Ctrl+Cmd+U"       "Ctrl+Cmd+X"       "Ctrl+Cmd+Y"

Managing Shortcuts

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)

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.

Code of conduct

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.

remedy's People

Contributors

aoles avatar colinfay avatar dpprdan avatar jonmcalder avatar jonocarroll avatar statnmap avatar yonicd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

remedy's Issues

Remove the extra empty lines in the inserted chunks

By default, an inserted new chunk has three empty lines. Can we reset it to have only one empty line?

If I select some lines of code, and apply chunk to it, the chunk will have one empty line above the code and below the code. Can we set the default not to have these empty lines?

Error: undefined exports

When I try to install the add-in using the following command:

devtools::install_github("ThinkR-open/remedy")

I get the following error and the install fails:

Downloading GitHub repo ThinkR-open/remedy@master
from URL https://api.github.com/repos/ThinkR-open/remedy/zipball/master
Installing remedy
"C:/R/R-3.4.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore  \
  --quiet CMD INSTALL  \
  "C:/Users/latour/AppData/Local/Temp/1/RtmpQB8dIX/devtools2acc14ec14ae/ThinkR-open-remedy-3ef6f36"  \
  --library="C:/Users/latour/Documents/R/win-library/3.4" --install-tests 

* installing *source* package 'remedy' ...
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for 'remedy' in namespaceExport(ns, exports):
 undefined exports: downr
Error: loading failed
Execution halted
ERROR: loading failed
* removing 'C:/Users/latour/Documents/R/win-library/3.4/remedy'
Installation failed: Command failed (1)

Prevent auto-naming

The chunk tool automatically names my chunks but I don't want them named. I can use remedy::remedy_opts$set(name="") but it will still number them. What if we had a option that was remedy::remedy_opts$set(name="None") that prevented auto-naming?

Toggle header symbols

Sometimes I want to change the header of a line from H1 to H2, etc. it would be nice to be able to ‘toggle’ header status similar to the built in rstudio comment shortcut.

This would also be nice for lists!
I appreciate all that you’ve done already in this package!

Error installing: "object '.rs.addins.savedShinyResponseFilter' not found"

With RStudio 1.2.5033 and R 3.6.3, in the console I enter:

> remotes::install_github("ThinkR-open/remedy")

Everything seems to go smoothly until I get:
* DONE (remedy) Error in options(shiny.http.response.filter = .rs.addins.savedShinyResponseFilter) : object '.rs.addins.savedShinyResponseFilter' not found
Then if I enter:
> library(remedy)
I get:
Error in options(shiny.http.response.filter = .rs.addins.savedShinyResponseFilter) : object '.rs.addins.savedShinyResponseFilter' not found

Do not see the Addins

Hi,

Thank you for developing the package.

I installed remedy package and closed my RStudio and reopen the program. However, I do not see the Addins function in my program.

screen shot 2018-11-02 at 11 58 16 am

Could you hep on this? Thank you.

Automatically update chunk name

Thanks for the great tool!

Q1: Suppose I created the following two chunks:

```{r MyOwesomeCodeChunk1} plot(cars) ```

```{r MyOwesomeCodeChunk2} plot(cars) ```

I deleted the first code chunk, and then create a new chunk.

The new chunk automatically get a name as MyOwesomeCodeChunk2. However, the previous second chunk MyOwesomeCodeChunk2 (which is now the first chunk) stay as MyOwesomeCodeChunk2. Therefore, there are now two chunks with the same name as MyOwesomeCodeChunk2.

How to fix this?

Q2: Some of my chunks got names like MyOwesomeCodeChunk001, MyOwesomeCodeChunk002, ... some of them got names like MyOwesomeCodeChunk08, MyOwesomeCodeChunk09. How to fix them?

Q3: Can I automatically delet all the chunk names?

Q4: How to disable automatically naming chunk?

Thanks!

bug in downr

downr doesn't handle multiple lines correctly, i'm on it !

The add-in `List ` doesn't works when there is <">

Just the gif is clear.

""
#> [1] ""

Created on 2018-11-10 by the reprex package (v0.2.1)

Session info
devtools::session_info()
#> ─ Session info ──────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 3.5.1 (2018-07-02)
#>  os       macOS  10.14                
#>  system   x86_64, darwin15.6.0        
#>  ui       X11                         
#>  language (EN)                        
#>  collate  zh_CN.UTF-8                 
#>  ctype    zh_CN.UTF-8                 
#>  tz       Asia/Shanghai               
#>  date     2018-11-10                  
#> 
#> ─ Packages ──────────────────────────────────────────────────────────────
#>  package     * version date       lib source        
#>  assertthat    0.2.0   2017-04-11 [1] CRAN (R 3.5.0)
#>  backports     1.1.2   2017-12-13 [1] CRAN (R 3.5.0)
#>  base64enc     0.1-3   2015-07-28 [1] CRAN (R 3.5.0)
#>  callr         3.0.0   2018-08-24 [1] CRAN (R 3.5.0)
#>  cli           1.0.1   2018-09-25 [1] CRAN (R 3.5.0)
#>  crayon        1.3.4   2017-09-16 [1] CRAN (R 3.5.0)
#>  desc          1.2.0   2018-05-01 [1] CRAN (R 3.5.0)
#>  devtools      2.0.1   2018-10-26 [1] CRAN (R 3.5.1)
#>  digest        0.6.18  2018-10-10 [1] CRAN (R 3.5.0)
#>  evaluate      0.12    2018-10-09 [1] CRAN (R 3.5.0)
#>  fs            1.2.6   2018-08-23 [1] CRAN (R 3.5.0)
#>  glue          1.3.0   2018-07-17 [1] CRAN (R 3.5.0)
#>  htmltools     0.3.6   2017-04-28 [1] CRAN (R 3.5.0)
#>  knitr         1.20    2018-02-20 [1] CRAN (R 3.5.0)
#>  magrittr      1.5     2014-11-22 [1] CRAN (R 3.5.0)
#>  memoise       1.1.0   2017-04-21 [1] CRAN (R 3.5.0)
#>  pkgbuild      1.0.2   2018-10-16 [1] CRAN (R 3.5.0)
#>  pkgload       1.0.2   2018-10-29 [1] CRAN (R 3.5.0)
#>  prettyunits   1.0.2   2015-07-13 [1] CRAN (R 3.5.0)
#>  processx      3.2.0   2018-08-16 [1] CRAN (R 3.5.0)
#>  ps            1.2.1   2018-11-06 [1] CRAN (R 3.5.0)
#>  R6            2.3.0   2018-10-04 [1] CRAN (R 3.5.0)
#>  Rcpp          1.0.0   2018-11-07 [1] CRAN (R 3.5.0)
#>  remotes       2.0.2   2018-10-30 [1] CRAN (R 3.5.0)
#>  rlang         0.3.0.1 2018-10-25 [1] CRAN (R 3.5.0)
#>  rmarkdown     1.10    2018-06-11 [1] CRAN (R 3.5.0)
#>  rprojroot     1.3-2   2018-01-03 [1] CRAN (R 3.5.0)
#>  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.5.0)
#>  stringi       1.2.4   2018-07-20 [1] CRAN (R 3.5.0)
#>  stringr       1.3.1   2018-05-10 [1] CRAN (R 3.5.0)
#>  testthat      2.0.0   2017-12-13 [1] CRAN (R 3.5.0)
#>  usethis       1.4.0   2018-08-14 [1] CRAN (R 3.5.0)
#>  withr         2.1.2   2018-03-15 [1] CRAN (R 3.5.0)
#>  yaml          2.2.0   2018-07-25 [1] CRAN (R 3.5.0)
#> 
#> [1] /Library/Frameworks/R.framework/Versions/3.5/Resources/library

I've read that we need the {rsam} package to set and manage the hotkey settings of {remedy} but the {rsam} package was removed from the CRAN repository. How are we able to use keyboard shortcuts with {remedy} without {rsam}? Is there another way?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

option to open urls in new tab?

Is your feature request related to a problem? Please describe.
I am regularly using remedy's RStudio add-in including the url function. As it is, the created link will open the linked page in the same browser window. This is not always intended, and the url has to be manually modified if one wants the link to get opened in a new tab.

Describe the solution you'd like
It would be great to have a function e.g. url_external or an option to url in remedy which specifies that the link has to open in a new tab.

Describe alternatives you've considered
Manual modification of link, which can be cumbersome.

Many thanks!

Include standard column breaks

Hi,

First of all, thanks a lot for your package, which simplifies working with RMarkdown a lot.

I was wondering whether it would be possible to include similar to the xaringan pull-left and pull-right template a standard way of inserting a column break.

I prefer using ioslides and hence I need to wrap my markdown text and my chunks into html tags. I am not sure yet what would be the best way to include this feature but I guess many people work with separated columns and this would save them a lot of time.

What do you think?

Best, Pascal

Feature request: line break <br>

Is your feature request related to a problem? Please describe.
I often want to insert some white space between paragraphs

Describe the solution you'd like
A simple way to insert return
return
within remedy

Feature request: data dictionary

Maybe this is outside the scope of the package, but I often start analyses by defining the variables in a dataframe. Similar to the table function, a function could turn the colnames of a dataframe or tibble into a list something like this:

+ `Sepal.Length` (numeric): description
+ `Sepal.Width` (numeric): description
+ `Petal.Length` (numeric): description
+ `Petal.Width` (numeric): description
+ `Species` (factor): description

Chunck option in remedy not showing

Hi there,

Your package really accelerates working in Rmarkdown. It has made life lot easier.
As I also work with Perl 6 along with R, my work would be easy if I can make code chunk option from

to

For what I mean, see here.

To make this happen what I did was cloned and edited this file.

I edited the line 11 of that file from

rstudioapi::insertText(location = a$selection[[1]]$range, text = paste0("```{r}\n", a$selection[[1]]$text, "\n```"))
to

rstudioapi::insertText(location = a$selection[[1]]$range, text = paste0('```{perl, engine.path="perl6"}\n', a$selection[[1]]$text, '\n```'))

and after that installed the local package with devtools::install command. Though it installs without any error, however the remedy options don't pop in Addins in RStudio.

I am on Windows 10 64 bit with RStudio Version 1.1.350 – © 2009-2017 RStudio, Inc.
For my needs I have made my own docker image too.

What could I be missing?

Best,
Suman

Align tilde

I think an "align tilde", equivalent to "align" and "align equal" would be handy. I'd use it all the time in case_when():

image

Overlap with stylermd

Cool package. As I am working with R markdown a lot because of bookdown, I created stylermd to make markdown text fit a character limit. This is trivial for 80% of the cases, but then you get nested enumerations, latex equations ect. -.-

I am wondering how these two packages overlap? Also, stylermd will be integrated into styler (in the sense that styler will import functionality, stylermd will remain an independent package, r-lib/styler#410) when matured. So this is not really an issue, just wanted to let you know about stylermd so we can discuss potential overlap. I am also happy for you to re-export the functionality if that is an option for you, but stylermd is not yet on CRAN and needs more user exposure.

Running `remedy::set_hotkeys()` on Mac has no effect

Hi,
The function for setting key bindings doesn't seem to work for me. After running remedy::set_hotkeys() and restarting RStudio no key bindings are added, even setting overide = TRUE doesn't help. Observed on Mac under RStudio 1.1.453.

Cheers,
Andrzej

Request insertion of html comments for text

A feature i would find useful is an insert of html comment tags in markdown text outside of a chunk with the cursor landing inside, ready for typing as in:
<!-- 'cursor lands here' -->
Thanks!

have the table addin convert actual data

have the addin lookup highlighted text for a data.frame in the global envir and loadedNamespaces and convert the object directly into a md table

basically a wrapper for knitr::kable

the package should detect if the user is in mac or windows to set default keyshort cuts considering that

Hello i'm a windows r user and the default shortcuts use cmd that is proper from mac, could you implement a default for windows users maybe replacing cmd with shift? thanks.

I run this:

hotkeys <- remedy::[remedy_opts](https://thinkr-open.github.io/remedy/reference/remedyOpts.html)$[get](https://rdrr.io/r/base/get.html)("hotkeys")
rsam::set_shortcut([sprintf](https://rdrr.io/r/base/sprintf.html)('remedy::%sr',[names](https://rdrr.io/r/base/names.html)(hotkeys)), hotkeys)

Feature request: rmarkdown verbatim chunk / inline

I'm frustrated when I want to show an rmarkdown chunk inside a rmarkdown document - in github, you can use four backticks and get the following:

```{r chunk-name, fig.align = "center"}
```

But this does not work for rmarkdown - @gadenbuie recently kindly reminded me of the trick from Yihui on how to shoe a verbatim chode chunk or inline E Expression

Describe the solution you'd like
I'd love for verbatim to have two options:

  • "Show verbatim code chunk", and
  • "Show verbatim inline R expression"

Describe alternatives you've considered

At the moment the alternative is for me to remember this in my head, which I don't, and I find it hard to have a clear conceptual framework to remember that

`r ''`

will break knitr's chunk parser and allow me to show the thing I want.

Additional context

I think that's about it - just, in general, thanks for writing this super nifty package!

"bold" does not work for me

When using bold in the addin menu, instead of **, I get __ (2 subscripts)...
I am using RStudio 1.2.1163 on a mac (OS X 10.14.2)

`List` addin doesn't work for Chinese text

Describe the bug

When I use List addin for Chinese text, it fails to add 1. or + before the first charactor of each line.

To Reproduce

Here is the input.

我asd
我我asd
我我我asd

After using the addin List,

我1. 我asd
我我1. 我我asd
我我我1. 我我我asd

Expected behavior

1. 我asd
1. 我我asd
1. 我我我asd

Environment (please complete the following information):

Session Info
> devtools::session_info()
Session info -----------------------------------------------------------------------
setting  value                       
version  R version 3.5.1 (2018-07-02)
system   x86_64, darwin15.6.0        
ui       RStudio (1.1.456)           
language (EN)                        
collate  zh_CN.UTF-8                 
tz       Asia/Shanghai               
date     2018-08-04                  

Packages ---------------------------------------------------------------------------
package    * version    date       source                             
backports    1.1.2      2017-12-13 CRAN (R 3.5.0)                     
base       * 3.5.1      2018-07-05 local                              
blogdown     0.8        2018-07-15 CRAN (R 3.5.0)                     
bookdown     0.7        2018-02-18 CRAN (R 3.5.0)                     
compiler     3.5.1      2018-07-05 local                              
curl         3.2        2018-03-28 CRAN (R 3.5.0)                     
datasets   * 3.5.1      2018-07-05 local                              
devtools     1.13.6     2018-06-27 CRAN (R 3.5.0)                     
digest       0.6.15     2018-01-28 CRAN (R 3.5.0)                     
evaluate     0.11       2018-07-17 CRAN (R 3.5.0)                     
git2r        0.23.0     2018-07-17 CRAN (R 3.5.0)                     
graphics   * 3.5.1      2018-07-05 local                              
grDevices  * 3.5.1      2018-07-05 local                              
htmltools    0.3.6      2017-04-28 CRAN (R 3.5.0)                     
httr         1.3.1      2017-08-20 CRAN (R 3.5.0)                     
knitr        1.20       2018-02-20 CRAN (R 3.5.0)                     
magrittr     1.5        2014-11-22 CRAN (R 3.5.0)                     
memoise      1.1.0      2017-04-21 CRAN (R 3.5.0)                     
methods    * 3.5.1      2018-07-05 local                              
R6           2.2.2      2017-06-17 CRAN (R 3.5.0)                     
Rcpp         0.12.18    2018-07-23 CRAN (R 3.5.0)                     
remedy       0.0.0.9700 2018-08-03 Github (ThinkR-open/remedy@6373d30)
rmarkdown    1.10       2018-06-11 CRAN (R 3.5.0)                     
rprojroot    1.3-2      2018-01-03 CRAN (R 3.5.0)                     
rstudioapi   0.7        2017-09-07 CRAN (R 3.5.0)                     
stats      * 3.5.1      2018-07-05 local                              
stringi      1.2.4      2018-07-20 CRAN (R 3.5.0)                     
stringr      1.3.1      2018-05-10 CRAN (R 3.5.0)                     
tools        3.5.1      2018-07-05 local                              
utils      * 3.5.1      2018-07-05 local                              
withr        2.1.2      2018-03-15 CRAN (R 3.5.0)                     
xfun         0.3        2018-07-06 CRAN (R 3.5.0)                     
yaml         2.2.0      2018-07-25 CRAN (R 3.5.0)   

Additional context
In the previous version, this addin fits Chinese characters.

Failing tests

These tests fail for me when sourced in RStudio.

> source('test-image.R')
 Error: Test failed: 'images: empty'
* argument is of length zero
1: imager() at test-image.R:18 
> source('test-url.R')
 Error: Test failed: 'urls: empty'
* argument is of length zero
1: urlr() at test-url.R:18 

The following produces an pop-up message window, but the test fails.

> source('test-right.R')
 Error: Test failed: 'rightr: one word'
* `rightr()` did not produce any messages. 

Clean pkgdown

The "docs" folder of pkgdown should not appear in the master.
This requires to change links to images/gif in the documentation because they won't be copied. A way is to store images in "man/figures" instead of "readme_gif" as this folder will be automatically copied. But this won't work for the Readme on gitub.
Another way is to use raw links of github.

Suggestion: add default hotkeys for Windows too

Hi,

your package is brilliant, but as far as I understand, currently remedy::set_hotkeys works only on iOS (right?). Would it be possible to extend it so that it defines a set of hotkeys on iOS, and another on Windows? Of course, if determining the operating system at runtime is hard, even just an argument remedy::set_hotkeys(os = c("Windows", "iOS") would be great. Thanks!

Feature request: Add session_info

Add a shortcut to insert session_info (similar to the reprex 📦)?

<details><summary>Session info</summary>  
```{r}
devtools::session_info()
```
</details>

right override text

When using right, if there is text after the selected text, it is overwritten.

Insert Latex Equation Skeleton

I'm just looking for a quick hotkey-enabled way to insert a latex equation into an RMarkdown file. I looked at your R code a bit. This might work? I'm not sure.

LtxEq <- function()
enclose("begin{equation}\n\n", "end{equation}\n")

Or maybe with fewer line breaks.

Feature Request: Comment Barrier

An addin to insert a Comment Barrier would be nice for organizing code.

commentBarrier <- function(){ a <- rstudioapi::getSourceEditorContext() if(!identical(a$selection[[1]]$text, "")){ rstudioapi::insertText(location = a$selection[[1]]$range, text = paste0("########################################\n#", a$selection[[1]]$text, "\n########################################\n")) }else{ rstudioapi::insertText(location = a$selection[[1]]$range, text = "########################################\n") rstudioapi::setCursorPosition(position = c(row = a$selection[[1]]$range$start["row"], column = a$selection[[1]]$range$start["column"] + 5)) } }
and in addins.dcf
Name: Comment Barrier Description: Convert selected text into comment block with barrier or insert new comment barrier Binding: commentBarrier Interactive: false

Feature suggestion: Make `Url` and `Img` context-aware

IMO, the default for inserting a URL (e.g. also here on Github) is to mark the link text, click on the URL button and then insert the URL (mostly copy & paste, at least for me). I.e. the selected text is put in the square brackets and not in the round brackets.

remedy::urlr(and imager) does this the other way around, however.

So how about making Url and Img context-aware, i.e. if the selection is a "URL" (if it contains a period, to catch internal links as well?), put it in the round brackets and set the curser between the square brackets. Else, use the selection as the link text, i.e. put it in square brackets and the curser between round brackets.
(Exception: if the selection is empty, handle it like a URL, i.e. cursor in square brackets).

Align | elements in a table

It would be nice to have a feature to align | in markdown tables:

|  alalala|  bibib|  ciii|
|--:|--:|--:|
|  1|  222|  3444|
|  23333|  3|  44|

Ignore `stan` block when adding names

Describe the bug

The chunkname function breaks stan code chunks.

To Reproduce

Create the following markdown:

---
title: "test"
output: html_document
---

` ``{r}

` ``


` ``{stan output.var="test"}

` ``

Use the adding for naming the code chunks:

---
title: "test"
output: html_document
---

` ``{r remedy01}

` ``


` ``{r remedy02,="test"}

` ``

Expected behavior

---
title: "test"
output: html_document
---

` ``{r remedy01}

` ``

` ``{stan output.var="test"}

` ``

Environment (please complete the following information):

Session Info
> devtools::session_info()
- Session info ---------------------------------------------------------------------------------------------
setting  value                       
version  R version 3.5.1 (2018-07-02)
os       Windows >= 8 x64            
system   x86_64, mingw32             
ui       RStudio                     
language (EN)                        
collate  English_United States.1252  
ctype    English_United States.1252  
tz       America/New_York            
date     2019-04-01                  

- Packages -------------------------------------------------------------------------------------------------
package     * version date       lib source        
assertthat    0.2.0   2017-04-11 [1] CRAN (R 3.5.1)
backports     1.1.3   2018-12-14 [1] CRAN (R 3.5.2)
callr         3.2.0   2019-03-15 [1] CRAN (R 3.5.3)
cli           1.0.1   2018-09-25 [1] CRAN (R 3.5.1)
colorspace    1.4-0   2019-01-13 [1] CRAN (R 3.5.2)
crayon        1.3.4   2017-09-16 [1] CRAN (R 3.5.1)
desc          1.2.0   2018-05-01 [1] CRAN (R 3.5.1)
devtools      2.0.1   2018-10-26 [1] CRAN (R 3.5.2)
digest        0.6.18  2018-10-10 [1] CRAN (R 3.5.1)
dplyr         0.8.0.1 2019-02-15 [1] CRAN (R 3.5.2)
fs            1.2.6   2018-08-23 [1] CRAN (R 3.5.1)
ggplot2       3.1.0   2018-10-25 [1] CRAN (R 3.5.1)
glue          1.3.1   2019-03-12 [1] CRAN (R 3.5.3)
gridExtra     2.3     2017-09-09 [1] CRAN (R 3.5.1)
gtable        0.2.0   2016-02-26 [1] CRAN (R 3.5.1)
hms           0.4.2   2018-03-10 [1] CRAN (R 3.5.1)
inline        0.3.15  2018-05-18 [1] CRAN (R 3.5.1)
knitr         1.22    2019-03-08 [1] CRAN (R 3.5.3)
lazyeval      0.2.1   2017-10-29 [1] CRAN (R 3.5.1)
loo           2.0.0   2018-04-11 [1] CRAN (R 3.5.1)
magrittr      1.5     2014-11-22 [1] CRAN (R 3.5.1)
matrixStats   0.54.0  2018-07-23 [1] CRAN (R 3.5.1)
memoise       1.1.0   2017-04-21 [1] CRAN (R 3.5.2)
munsell       0.5.0   2018-06-12 [1] CRAN (R 3.5.1)
pillar        1.3.1   2018-12-15 [1] CRAN (R 3.5.2)
pkgbuild      1.0.2   2018-10-16 [1] CRAN (R 3.5.1)
pkgconfig     2.0.2   2018-08-16 [1] CRAN (R 3.5.1)
pkgload       1.0.2   2018-10-29 [1] CRAN (R 3.5.2)
plyr          1.8.4   2016-06-08 [1] CRAN (R 3.5.1)
prettyunits   1.0.2   2015-07-13 [1] CRAN (R 3.5.1)
processx      3.3.0   2019-03-10 [1] CRAN (R 3.5.3)
ps            1.3.0   2018-12-21 [1] CRAN (R 3.5.2)
purrr         0.3.0   2019-01-27 [1] CRAN (R 3.5.2)
R6            2.4.0   2019-02-14 [1] CRAN (R 3.5.2)
Rcpp          1.0.1   2019-03-17 [1] CRAN (R 3.5.3)
readr         1.3.1   2018-12-21 [1] CRAN (R 3.5.2)
rematch2      2.0.1   2017-06-20 [1] CRAN (R 3.5.3)
remedy        0.1.0   2018-12-03 [1] CRAN (R 3.5.3)
remotes       2.0.2   2018-10-30 [1] CRAN (R 3.5.2)
rlang         0.3.2   2019-03-21 [1] CRAN (R 3.5.3)
rprojroot     1.3-2   2018-01-03 [1] CRAN (R 3.5.2)
rstan         2.18.2  2018-11-07 [1] CRAN (R 3.5.1)
rstudioapi    0.9.0   2019-01-09 [1] CRAN (R 3.5.2)
scales        1.0.0   2018-08-09 [1] CRAN (R 3.5.1)
sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.5.2)
StanHeaders   2.18.1  2019-01-28 [1] CRAN (R 3.5.2)
tibble        2.0.1   2019-01-12 [1] CRAN (R 3.5.2)
tidyselect    0.2.5   2018-10-11 [1] CRAN (R 3.5.1)
usethis       1.4.0   2018-08-14 [1] CRAN (R 3.5.2)
withr         2.1.2   2018-03-15 [1] CRAN (R 3.5.1)
xfun          0.5     2019-02-20 [1] CRAN (R 3.5.3)
yaml          2.2.0   2018-07-25 [1] CRAN (R 3.5.1)

[1] C:/Users/imartinez/Documents/R/win-library/3.5
[2] C:/Program Files/R/R-3.5.1/library

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.