CiteDrive + R Markdown + R Shiny - RStudio

Sourcing hosted BibTeX (.bib-file):

  • How to synchronise the hosted BibTeX file from CiteDrive to the R-Studio project?
    • CiteDrive generates via API a link with a BibTeX file, which represents the latest state of the project of all collected references.
    • Link will be passed in a function via R, which downloads the latest up to date entries triggered via Knitr.
    • All references are then accessible and Citations can be inserted in Pandoc fashion.
      • Provides remote and on premise accessibility to the references.
---
title: ...
author: ...
bibliography: citedrive.bib
csl: vancouver.csl
date: "26 10 2020"
output:  ...
---

bibliography - defines path to file (.bib) containing all references (provided by CiteDrive’s API)
csl - citation style language: an xml-file which defines the output style of in-text citations and bibliography. Citeproc Pandoc is used by R-Markdown to depict the correct styling.

Sourcing .cls-Styles:

  • Sourcing all citation styles from the official github repo
  • Extracting .cls files using github’s API.
clsList <-
  jsonlite::fromJSON("https://api.github.com/repos/citation-style-language/styles/git/trees/master")
clsList <- grep(".csl", as.matrix(clsList$tree$path), value = TRUE)

Mockup GUI for selection of csl:

  • Selection of multiple entries for citations is problematic.
  • Loading large amounts of entries in the UI-Portion may cause performance issues
    • toDo: find a way to load data in the server-Portion of the Shiny app.

toDo:

  • Add apply button to UI.
  • Pass data efficiently from UI to Server.
  • Insert field to paste CiteDrive link to fetch references.
    • If possible, save link between sessions.
    • Pre-select “Citation”-Window if a link has been provided.
  • Automatically apply cls to R-Markdown project (on button press from Settings page).
  • Insert citations at cursor position in R-Markdown project.

Passing data from shiny app

  • Data is now sourced in server-portion of the Shiny app (using selectizeInput) to improve performance.
  • Directly inserting strings into R-Markdown files may be more difficult than anticipated.
    • First implementation will be using rclipboard to load reference-/citation keys into the user’s clipboard for manual insertion.

toDo:

  • Insert field to paste CiteDrive link to fetch references.
    • If possible, save link between sessions.
    • Pre-select “Citation”-Window if a link has been provided.
  • Add rclipboard functionality.

Copy paste functionality

  • Added copy paste functionality for cls-style selection and references for manual insertion into R-Markdown projects.