Home Comments Thread
New Thread

11 Comments

giscus-bot giscus-bot 2022-12-17 04:32:26
Guest *Kevin Ushey* @ 2018-10-19 19:42:46 originally posted:

I wonder if GitHub would be amenable to enable soft-wrap in Markdown documents (or at least providing some option for it)?

yihui yihui 2022-12-17 04:32:35

Let me ask them ( github/markup#1235 ). It is a relatively simple CSS change, so they might be amenable.

Originally posted on 2018-10-19 20:28:50

giscus-bot giscus-bot 2022-12-17 04:32:27
Guest *Julia Silge* @ 2018-10-19 20:48:39 originally posted:

Oh, I for one am quite happy about this! I have wanted to be able to link to specific lines for a long time.

giscus-bot giscus-bot 2022-12-17 04:32:28
Guest *Maëlle Salmon* @ 2018-10-20 04:05:56 originally posted:

It sounds like a good idea! I'll check that repos I know/am responsible for don't have a README.Rmd as preferred README (I've seen that in the wild). 🙂

giscus-bot giscus-bot 2022-12-17 04:32:36
Guest *Maëlle Salmon* @ 2018-10-20 04:12:53 originally posted:

Actually README.Rmd still seem rendered cf https://github.com/ropensci/magick

giscus-bot giscus-bot 2022-12-17 04:32:37
Guest *Maëlle Salmon* @ 2018-10-20 04:17:04 originally posted:

I mean as README when landing on the repo, because the source is not rendered as Markdown. https://github.com/ropensci/magick/blob/master/README.Rmd

giscus-bot giscus-bot 2022-12-17 04:32:38
Guest *Perry* @ 2018-10-20 04:30:05 originally posted:

This seems like the ideal way to treat Rmd. When you view the file, it displays as code. When you view the repo, if the only README is an Rmd file, it tries to render it as markdown to make the repo look more pro.

giscus-bot giscus-bot 2022-12-17 04:32:29
Guest *Perry* @ 2018-10-20 04:27:43 originally posted:

Thank you! Rmd files aren't meant to be rendered directly, they're meant to be source files. I hope this flows through to the enterprise product too as it's making it really hard to show colleagues Rmd files.

giscus-bot giscus-bot 2022-12-17 04:32:30
Guest *dmanuel* @ 2018-10-21 09:05:55 originally posted:

The original concept of markdown is pretty much dead: "to write using an easy-to-read and easy-to-write plain text format, optionally convert it to structurally valid XHTML (or HTML)". Using .Rmd instead of .md helps tremendously because different .md files are also not rendered the same. At least with Rmd you aren't expecting the same render.

giscus-bot giscus-bot 2022-12-17 04:32:30
Guest *Aaron Simumba* @ 2018-10-22 09:46:48 originally posted:

I love this. You have to bleed to heal...

giscus-bot giscus-bot 2022-12-17 04:32:31
Guest *Jim Hester* @ 2018-10-23 16:33:03 originally posted:

I generally think this is an unfortunate step backwards and am sad it has been reverted. I think we could have worked with GitHub to improve the R markdown rendering rather than removing it entirely.

Also FWIW it is definitely possible to link to a specific revision in the blame view, for instance https://github.com/yihui/xaringan/blame/ce902f48f650f677a7eda6ec50e5e99cea3e1997/inst/examples/lucy-demo.Rmd#L20 from the example in the post. You can actually have GitHub convert any link to the absolute version by pressing 'y' on a page. See https://help.github.com/articles/getting-permanent-links-to-files/ for details.

yihui yihui 2022-12-17 04:32:38

Thanks for the 'y' trick. I do use it occasionally. I don't know why I forgot it this time. But even that is possible, it is still a hack that requires you to click the Blame button (which beginners may have absolutely no idea of, given that they don't even know what the Raw button does), and press 'y'. And the Blame view is a weird view: you have the commit history on the left side.

So basically you think the rendered view is more important than the Rmd source? Of course I'd respect your opinion. As I said, there's nothing absolutely right or wrong. It is just that the loss seems to be severer when Github renders Rmd as md. The loss of displaying Rmd verbatim is not zero, but at least verbatim R Markdown is still somewhat human-readable. If someone really prefers readability, she should the real output document (PDF, HTML, etc). BTW, when you open an Rmd file anywhere else, you see the source (e.g. in RStudio); I think it is very confusing when you open an Rmd on Github only to find it shows you an HTML page. The inconsistency confuses R Markdown users, and when you pass an Rmd file to them on Github, they may have no idea what R Markdown is since the true source is hidden.

That said, I didn't mean this was the end. Yes, "we could have worked with Github to improve the R Markdown rendering", but honestly I believe it will be a non-trivial amount of work: they'll have to write a special R Markdown parser in order to preserve the chunk headers while rendering everything else to HTML. Even they are able to do that, if someone wants to copy anything from an Rmd file, she still has to go to the Raw or Blame view.

The easier path to move forward to make both you and me comfortable is to add a button to preview Rmd as md on the toolbar of the file on Github. I think the infrastructure is already there (e.g. they already do this for diffs: https://blog.github.com/2014-02-14-rendered-prose-diffs/ ). Please feel free to reach out to Github if you think that is a good idea. I think I was lucky this time that it only took a little more than a month to get the original PR reverted. We have had issues like rstudio/rmarkdown#1020 (comment) that have not been dealt with for more than a year after we sent our request to Github: just to give you an idea about the possible time required to change or implement anything if the work is even slightly non-trivial.

Originally posted on 2018-10-23 19:08:11

giscus-bot giscus-bot 2022-12-17 04:32:32
Guest *Corina Logan* @ 2018-10-24 14:57:58 originally posted:

I was wondering why the sudden change at my repo for all of my .Rmd files. I love the line numbering! One thing that I'm having a hard time with is that I submit my .Rmd files for peer review (at PCI Ecology) and the reviewers read my research at GitHub. The editors are already having trouble finding reviewers who are willing to look at a different file type and I'm afraid even more reviewers will refuse to review if they have to horizontally scroll to read the text. It looks like your CSS fix above only fixes it on the browser that one is reading from and I don't think reviewers will go to the trouble of setting up their browser to read and evaluate my research. Is there something I can do in the code of my .Rmd file or at my GitHub repo to wrap text? Thanks!

yihui yihui 2022-12-17 04:32:39

I have requested soft-wrapping to a Github engineer: github/markup#1235

For reviewers, I think it may be better to let them review the output file instead of the source file. The source file is more for those who are interested in reproducing your paper. The output file could be PDF, HTML, or Markdown. If you have to ask them to review on Github, I recommend that you render .Rmd to .md (the output document format can be github_document, which is included in the rmarkdown package), so reviewers can read a nicely rendered .md document.

Originally posted on 2018-10-24 15:21:48

giscus-bot giscus-bot 2022-12-17 04:32:41
Guest *Corina Logan* @ 2018-10-24 15:33:26 originally posted:

Thank you for making the soft-wrapping request at GitHub! I see that I can output to .md or github_document, but the problem is that I've already submitted 5 papers to PCI Ecology and if I add these other formats, the reviewers won't have the link. So I need to make my current .Rmd files work (and fast) because they are already under review.

yihui yihui 2022-12-17 04:32:41

I see. Sorry for the trouble!

Originally posted on 2018-10-24 16:00:29

giscus-bot giscus-bot 2022-12-17 04:32:33
Guest *daiyang* @ 2018-11-15 05:07:51 originally posted:

At least you could ask them to add a "render" button to render the .rmd file. Just like before the change, you could "raw" your rendered .rmd file to see the source code. The option of rendering .rmd files shouldn't be eliminated.

yihui yihui 2022-12-17 04:32:42

I definitely agree, and it is exactly what I said below when replying Jim Hester: https://yihui.name/en/2018/10/rmd-github/#comment-4159071055

Originally posted on 2018-11-15 08:42:37

giscus-bot giscus-bot 2022-12-17 04:32:33
Guest *kirikirikirixxx* @ 2020-01-28 21:25:45 originally posted:

Every time somebody says he or she uses Google Chrome, a baby fox dies unborn. 🦊

giscus-bot giscus-bot 2022-12-17 04:32:34
Guest *zp* @ 2020-07-14 05:34:10 originally posted:

There is some discussion regarding integration of Rmd support in GitLab. I am sure there's a good sweet-spot of support that keeps the code visible but makes editing and reading easier.

see this page for details: https://gitlab.com/gitlab-org/gitlab/-/issues/24003

edited link to new one

Sign in to join the discussion

Sign in with GitHub