yihui / knitr

A general-purpose tool for dynamic report generation in R
https://yihui.org/knitr/
2.37k stars 874 forks source link

Request: Make the markdown a (hard) dependency again #2206

Closed vnijs closed 1 year ago

vnijs commented 1 year ago

knitr functionality has hard dependencies on the markdown package. As an example, a recent change in knitr caused an error that is hard to diagnose for a user (https://github.com/radiant-rstats/radiant/issues/193#issuecomment-1362292052). I understand that limiting the number of hard dependencies is important, however, this will likely be confusing to the many users of the knitr package and also to the authors of the many packages that depend on or import from knitr. Package authors may have to add hard decencies on markdown package versions even if they don't use it directly.

If adding markdown as a hard dependency is not possible, perhaps informative error messages could be added?

Thanks for your consideration


By filing an issue to this repo, I promise that

I understand that my issue may be closed if I don't fulfill my promises.

yihui commented 1 year ago

We have made a lot of effort to move markdown from Imports to Suggests (#1864). It's very unlikely that we'll move it back. I agree that the problem in https://github.com/radiant-rstats/radiant/issues/193 is confusing. I'm not sure how often it can happen, i.e., how likely it is for users to install knitr only but not to update all packages.

The main function that uses markdown is knitr::knit2html(), which is not a core function but a simple wrapper function for convenience. If radiant relies relatively heavily on it, I suggest you make markdown a hard dependency of it.

Anyway, I have added a more specific error message. Thanks for your suggestion!

github-actions[bot] commented 1 year ago

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.