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

migrate to pandoc-citeproc for references #45

Closed
maxheld83 opened this issue Oct 9, 2018 · 2 comments
Closed

migrate to pandoc-citeproc for references #45

maxheld83 opened this issue Oct 9, 2018 · 2 comments

Comments

@maxheld83
Copy link

maxheld83 commented Oct 9, 2018

as I understand, most other rmarkdown formats support citations via pandoc-citeproc, which has a bunch of advantages:

@jjallaire mentioned in #24 that radix currently uses distill, which in turn uses some js bibtex parser, which might be hard to disentangle.

I'm wondering whether it might be possible/might make sense to just ignore that part of distill, and do the usual rmarkdown pandoc-citeproc dance.

I'm in no position to say whether this would sit well with the rest of distill (does it do any additional black magic to citations?).
I guess the CSS would have to change a bit to retain the hover-citations (which are great).

If so, I might try to take a whack at this.

I just think it'd be a great benefit to rmarkdown users if all rmarkdown formats behave roughly the same when it comes to these features wrapped from pandoc.

@jjallaire
Copy link
Member

Distill does quite a bit with citations so I think it would take a decent amount of effort to replicate this. Roughly you'd need to do this:

  1. Don't write the Distill bibliography: https://github.com/rstudio/radix/blob/master/R/appendices.R#L14-L22

  2. Don't convert citations to <d-cite>: https://github.com/rstudio/radix/blob/master/inst/rmarkdown/templates/radix_article/resources/distill.html#L532-L539

That would effectively disable what Distill does now. You'd then want to reproduce both the production of the bibliography appendix as well as the Distill JavaScript/CSS for inline citations. I'm not sure exactly where that is in Distill but I see these references in the Distill source code to the hover_site() function: https://github.com/distillpub/template/search?utf8=%E2%9C%93&q=hover_cite&type=

This is a rough summary, there may be other devil in the details here that I'm not aware of. Definitely not a simple project, but certainly do-able.

@jjallaire
Copy link
Member

I just pushed a change that should address this (we now use pandoc to generate the bibliography rather than the distill framework): e8585bc

You can install this with remotes::install_github("rstudio/distill")

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

No branches or pull requests

2 participants