rstudio/rmarkdown

lib_dir without dependency versioning: allowing HTML files generated at different points in time with different rmarkdown versions to use same lib_dir

Closed this issue · 3 comments

Currently, a Rmarkdown file rendered to HTML with option lib_dir: libs will create a libs folder with the dependencies, appended by their version names e.g. 'bootstrap-3.3.5', 'jquery-1.11.3', which are linked in the header of the generated HTML file. This means, that if I generate another Rmarkdown file at a different point in time, and I want it to use the same lib_dir, say, because I want to place these HTML documents jointly inside a directory on a server with a libs subdirectory containing the libraries, then only a minor version change of any of these libraries inhibit my new HTML file to display properly on my server, simply because the version number in the folder name changed.

I would thus like to request an option to omit version numbers from the folder names in dependencies together with option lib_dir e.g. so that the folders are named bootstrap and jquery and not 'bootstrap-3.3.5' and 'jquery-1.11.3'.

It is clear that open source software is evolving and that this will at some point cause code to break, or, in this case, HTML outputs to display in a wrong way. However, most of the time minor version changes of major libraries do not break much at all. With the current naming of dependency folders, a minor version change breaks code by design, and the only way around it is a totally unnecessary duplication of the dependencies for each new Rmarkdown file generated for serving from the web.

So having an option allowing generic dependency names and linking would be much more conducive to people wanting to serve multiple Rmarkdown files off a web-server.

yihui commented

Of course I agree with you and have added an option to omit the version number in 2015 (rstudio/htmltools#37):

options(htmltools.dir.version = FALSE)

Ahh, great, thanks a lot! Maybe I was not thorough enough in my search for this solution, but mentioning this option on ?rmarkdown::html_document or somewhere in the book cannot be harmful either.

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.