Linking to other pages on Simple R markdown website - r

I'm developing a Simple R Markdown Website, and want to include a few links to other .Rmd generated HTML pages on the home page.
Simply, I want to open up "detailed-desc.html" which is rendered from "detailed-desc.Rmd", on clicking a text element on the "index.Rmd" file. I'm not sure how this can be done.

If all your .Rmd files and their rendered HTML results are in the same directory, then you can use the regular markdown syntax and reference the HTML files for links.
[Detailed Description](detailed-desc.html)
Detailed Description
With a more complicated site folder structure, it is just
[Detailed Description](./path/to/your/folder/detailed-desc.html)
Detailed Description

Related

Transferring/emailing files created by Quarto

When I would create a html document in RMarkdown, the file transfer/email process was straightforward; I would simply transfer/email the resulting html file.
However, when I try to do the same with a Quarto document, I do not get all of the functionality in the transferred file. For example, my Quarto document includes tabs using the ::: {.panel-tabset} option. When I open the transferred html document, the panel-tabsets are not displayed properly.
I believe that this is because Quarto also produces files in a separate directory. However, I trying to programmatically email the html document out to a distribution, and sendmailR is not letting me attach this directory.
Furthermore, my distribution list are NOT technical folks. I am not looking to have to tell them to save these files and then open the html; I was hoping to just attach the html file like I did with RMarkdown and have them natively open it just like an regular attachment.
What is the best way to transfer/email Quarto produced html documents?
Someone directed me to use the html: self-contained in the YAML header.
Based on that, I found this post which states what to do.
By putting the following in my YAML header, the resultant html file is self-contained:
---
format:
html:
self-contained: true
---

Hyperlink a pdf on local drive to rmarkdown html output

I am trying to make the citation of my report in rmarkdown to hyperlinks of the pdfs. I try the following:
[the citation](thefile.pdf)
This works on my computer but if I send it to someone else the links don't work. I understand that I am not doing this properly, but this is how I do it for URLs. Is there any way I can have these pdfs attached to the rmarkdown?
You would need to upload your pdf's to the internet somewhere, and then put that link in the parentheses in the code snippet in your post. That code you posted would only work if the person had the same file in the same place on their computer.
[Your file](A google drive/dropbox link)

Is there a way to force inline rendering of a file in Jekyll?

I have a blog in Jekyll and on one of the pages I have two links: one is to a .tex file and the other is to a .pdf file. When the link to the PDF file is clicked, the browser displays the PDF, no problem. However, when the link to the TeX file is clicked, the browser downloads the TeX file.
Is there a way to get the browser to display the TeX file as just plain text? This is the behaviour on some other websites. I know this is related to the Content-Disposition response in HTTP but how to I set this in a regular Jekyll Markdown file?
Thanks in advance for your help!

Use Rmd files for content pages in blogdown website

I am considering switching my website to blogdown. My current set-up only uses .Rmd files with a less-than-ideal blog implementation. It seems like one advantage of blogdown is that it automates the blogging part of the website (posts, lists, dates, etc.) and allows RMarkdown. This is my main motivation to switch. However, the downside, I think, is that I cannot create content pages in RMarkdown (i.e., content > about.Rmd)... it seems this is limited to .md files. I would like to use .Rmd for all the pages so that I can incorporate r code. My question: Is it possible to create .Rmd content pages in blogdown?
EDIT...
Specifically, I created by hand research.Rmd in the content folder. I can include a trivial example, such as...
`r 2 + 2`
and when I run serve_site() the r code is not rendered. I can knit the file by hand, but the file does not have the style of the theme I am using and once I again try to serve the site the file is rendered as if it were a .md file.
```
EDIT 2...
You can reproduce the behavior I am referring to by doing the following...
Create a new blowdown site: new_site(dir = ".", theme = 'gcushen/hugo-academic')
Create new content: new_content('test/index.Rmd')
Set draft to false and add trivial r code: I used 2 + 2 as shown above.
Serve site and go to test/index.html. There is no r code rendered.
From your Edit 2, you seem to have fallen into a common Hugo trap: content/test/index.Rmd does not necessarily generate test/index.html. Hugo uses the convention _index.md to generate a homepage for a subfolder, and you have to use content/test/_index.Rmd in your case. For content/about.Rmd or content/research.Rmd, they will generate about/index.html and research/index.html respectively by default.

sharing gitbook using `bookdown` package in `R` - other users do see all the chapters

I have a gitbook generated from the bookdown package in R, but I am not able to share the book with collaborators efficiently.
The problem is that if I send them the html generated as a gitbook, the front page (first chapter) shows up fine, but none of the links to other chapters work. The reason I believe is that the book is looking for html files for other chapters in the location in which clicking on other chapters were created even if I place the individual chapter html in the same folder as the main file.
My question is - how can I efficiently share the gitbook and make sure that the links work if all the chapter files are in the same folder.
Thanks!
SN

Resources