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

Adding a navbar to an existing HTML document [FR] #2309

Open
jdjohn215 opened this issue Feb 15, 2022 · 2 comments
Open

Adding a navbar to an existing HTML document [FR] #2309

jdjohn215 opened this issue Feb 15, 2022 · 2 comments
Labels
feature a feature request or enhancement

Comments

@jdjohn215
Copy link

@jdjohn215 jdjohn215 commented Feb 15, 2022

Thanks for such a great package!

I'm building a simple RMarkdown website. I have some already rendered HTML files, and for various reasons, it isn't feasible to re-render them within the RProj for the website. For example, I might not have access to the original Rmd file, or the Rmd file might only work within another Rproj directory.

I'm looking for a way to add the navbar to these existing HTML files.

I've searched through the documentation, googled a bunch, and asked on a couple help forums. Since I haven't turned up any answers on how to do this, I'm raising it has a feature request here. I think other people would likely find this feature very helpful too.

Does this seem like a possibility, or am I totally off base about its feasibility?

@jdjohn215 jdjohn215 changed the title Thanks for such a great package! [FR] Adding a navbar to an existing HTML document [FR] Feb 15, 2022
@cderv
Copy link
Collaborator

@cderv cderv commented Feb 16, 2022

Inserting an existing full HTML file (meaning with <head> and <body>) inside another is not something straighforward - or even feasible without a iframe logic.

Using an <iframe> to load an existing file in a R Markdown website is also a solution - the navbar would be present. But sometimes an iframe is not desirable. If you want to try that, creating a Rmd in your website and using a chunk with knitr::include.

Adding a navbar in R Markdown website is done by inserting some content in the HTML during the rendering of the Rmd document. This content is the same for all the document. To do that on existing HTML file, it would require a processing of the existing HTML file to either insert the same content or replace some of the content of the existing file.

I believe this is the same limitation with any other website - you can't easily insert an existing whole HTML within the context of another website where HTML components (like navbar, footer, sidebar) are shared. It is easier to do that if the existing HTML are framgment (only body part)

I don't know if R Markdown website will handle this specific usage of including any HTML file into a website - if it does it is not something that will be very soon. You could try on your own project by processing the file to include the missing part.

Thanks for the suggestion - I'll mark as a feature request open for votes with 👍

@cderv cderv added the feature a feature request or enhancement label Feb 16, 2022
@cderv
Copy link
Collaborator

@cderv cderv commented Feb 16, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants