knitr
automatically generates links when knitting .Rmd to .html. Very often that's useful, but just now it's not what I want.
Suppose you have this .Rmd file:
---
title: "Doc title"
output: html_document
---
I don't want [email protected], but it comes out that way.
If you wrap it in an R expression `r "[email protected]"`.
Is there some kind of CSS trick I can avail myself of if I wanted <style='nolink'>www.something.com</style> not to be a link?
Knitting like this:
library(knitr)
knit2html('that_file.Rmd', 'that_file.html')
results in all those things being links.
Is there an easy way to generally keep the auto-link generation, but disable it selectively in particular lines? Thanks for any thoughts.
Edit: i guess I should have actually tried the solution below before accepting. This in the .Rmd
I don't want this <!-- breaklink -->@to-be-a-link.com
...doesnt actually parse to an HTML comment, because the -- gets changed to an em dash (by knitr? pandoc?) and then I get:
You use results="hide" to hide the results/output (but here the code would still be displayed). You use include=FALSE to have the chunk evaluated, but neither the code nor its output displayed.
A recent version of Pandoc (>= 1.12. 3) is required to use the rmarkdown package. RStudio also automatically includes this so you do not need to download Pandoc if you plan to use rmarkdown from the RStudio IDE. If not using the RStudio IDE, you'll need to install Pandoc for your platform.
Hyperlinks are created using the syntax [text](link) , e.g., [RStudio](https://www.rstudio.com) . The syntax for images is similar: just add an exclamation mark, e.g., ![ alt text or image title](path/to/image) . Footnotes are put inside the square brackets after a caret ^[] , e.g., ^[This is a footnote.] .
Two options that I see are (1) using bare backticks, or (2) "breaking" the link by using an empty HTML comment.
Example:
---
title: "Doc title"
output: html_document
---
I don't want this<!-- -->@to-be-a-link.com, but it comes out that way.
If you wrap it in an R expression `[email protected]`.
Is there some kind of CSS trick I can avail myself of if I wanted
<style='nolink'>http<!-- -->://www.something.com</style> not to
be a link?
Becomes:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With