Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The rewrap doesn't work in .Rmd files #245

Closed
Andryas opened this issue Nov 17, 2020 · 8 comments
Closed

The rewrap doesn't work in .Rmd files #245

Andryas opened this issue Nov 17, 2020 · 8 comments

Comments

@Andryas
Copy link

Andryas commented Nov 17, 2020

What I need to do to allow the rewrap to work in .Rmd files?

@mihaiconstantin
Copy link

Any updates on this? I also really miss this feature and I wish to know whether there is anything that can be done here. As far as I can tell, when the R extension is enabled, VSCode correctly handles .rmd files and knows to differentiate between the r script books and the markdown ones.

@stkb
Copy link
Owner

stkb commented Feb 6, 2022

Yeah sorry I'll get on to this right away. As far as I can tell .rmd is exactly the same as a markdown document? (with a Yaml front-matter section)

@mihaiconstantin
Copy link

Thanks for taking a look at this @stkb!

Indeed, the .rmd document is a simple markdown file with a yml header. The only significant difference I can think of is that the code blocks have a special syntax declaration. For example, in a simple .md file an r code block would look like this:

```r
# A comment.
```

However, within a .rmd the code block will look like this:

```{r}
# A comment.
```

Often the {r} is extended with options, for instance:

```{r dev="pdf", fig.width=8, fig.height=8, out.width="200px", fig.align="center"}
# Some code that plots something.
```

Would this represent a problem?

@mihaiconstantin
Copy link

Yeah sorry I'll get on to this right away. As far as I can tell .rmd is exactly the same as a markdown document? (with a Yaml front-matter section)

Another thing is that you can also use LaTeX commands within an .rmd document. But I think Rewrap already plays nicely with .tex files.

stkb added a commit that referenced this issue Feb 7, 2022
@stkb
Copy link
Owner

stkb commented Feb 7, 2022

Ok it's now in pre-release version 17.6. The code blocks shouldn't be a problem. I'm not sure about the LaTeX since Rewrap doesn't really do content-types within content-types yet

@stkb stkb added the in pre-release version Is in pre-release version but not in stable yet label Feb 7, 2022
@mihaiconstantin
Copy link

Thanks a lot for adding support for .rmd files. I tested the pre-release on several .rmd files and it works really well!
@Andryas, I think this issue can be closed?

@stkb
Copy link
Owner

stkb commented Feb 8, 2022

@mihaiconstantin thanks, and I normally close issues once the fix is published in a stable version.

@Andryas Andryas closed this as completed Feb 8, 2022
stkb added a commit that referenced this issue Feb 14, 2022
stkb added a commit that referenced this issue Feb 14, 2022
- Support .rmd files as markdown (#245)
- Basic support for Textile files as markdown (#271)
- Support FIDL (#255), Pascal/Delphi (#97) & pylintrc files (#121)
- Shell script: Ignore shebangs (#129)
- Add '//'-comments to CSS (workaround for #309)
- Fix batch files: case-insensitive "REM" and "@" prefix (#313)
- Fix the document being 'modified' if there were no actual changes
  (#308, #315)
@stkb
Copy link
Owner

stkb commented Feb 14, 2022

Now also in stable v1.16.2

@stkb stkb removed the in pre-release version Is in pre-release version but not in stable yet label Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants