rstudio / rmarkdown-book

R Markdown: The Definitive Guide (published by Chapman & Hall/CRC in July 2018)
https://bookdown.org/yihui/rmarkdown
Other
781 stars 518 forks source link

Document your own solution using linguist-detectable to show R Markdown in Linguist GitHub repo language statistics #93

Open remlapmot opened 3 years ago

remlapmot commented 3 years ago

I don't know if this is better here or in your Cookbook.

I think it would be worth adding a short section documenting your own solution here to making RMarkdown appear in the Linguist Languages statistics of a GitHub repository by add the following line to the .gitattributes file

*.Rmd linguist-detectable

or even safer catch the fully lower case .rmd file extension as well

*.[Rr]md linguist-detectable

It would be worth explaining that by default Linguist ignores R Markdown (RMarkdown in Linguist) from the Languages statistics because it's defined as type: prose here and files of that type are excluded from the statistics without the linguist-detectable override as detailed here.

I assign the copyright of this contribution to the authors of the book "R Markdown: The Definitive Guide".