trackdown icon indicating copy to clipboard operation
trackdown copied to clipboard

allow quarto qmd files

Open richardjtelford opened this issue 2 years ago • 2 comments

I'd like to use trackdown with quarto documents (quarto is the successor to R markdown developed by RStudio, https://quarto.org/). The file extension in qmd rather than rmd, so check-suported_documents() throws an error.

It might be as simple as editing check_supported_documents() to

check_supported_documents <- function(file_info){
  if(!(file_info$extension %in% c("rmd", "rnw", "qmd"))) # check supported files
    stop(paste(file_info$file_name, "not supported file type (only .Rmd, .Rnw, or qmd)"), 
         call. = FALSE)
}

(I tried this but then had problems with google drive authentication that I was not able to fix)

richardjtelford avatar Apr 04 '22 21:04 richardjtelford

Hi @richardjtelford,

I did not know about Quarto, AMAZING! Thank you for pointing out this incredible initiative. I have immediately added support to quarto documents. To my understanding, they have the same exact syntax as r-markdown documents, so all trackdown features (hide-code, rich-text) should already work properly.

However, I am new to Quarto so for the moment I have created a separate new branch quarto with the required changes. Before merging into the master, I prefer to properly check how Quarto works and add unit-test dedicated to Quarto.

You can already install the quarto version running,

remotes::install_github("ClaudioZandonella/trackdown", ref = "quarto")

Regarding google drive authentication, the story is a little bit longer 😅.

Trackdown now uses its own app API credentials, but the app still needs to be verified by google. The process, unfortunately, is going slowly and actually, I am afraid that the app will not be accepted by google.

There are no security issues, trackdown works exactly the same as other r-packages (e.g., gooogledrive), so you can use trackdown without problems. The issue is that there are many requirements (e.g., display logo google and google drive) that need to be satisfied. It will be no problem on a GUI app, but impossible to do on the command line R interface.

Anyway, you can use trackdown on desktop application (Rstudio, R console) and authentication displays a warning message as discussed in https://github.com/ClaudioZandonella/trackdown/issues/28#issuecomment-1057195007. You need to accept and select all options.

Note that this does not work for oob (out-of-band) authentication done when working on browser for example when using R studio server, for example. Google verification is required for this. You would need to create your own personal token for google drive API, but it is a quite long-complex process. I have been trying to solve this whole issue but I am still working on it.

Please let me know which specific google drive authentication issue you found.

ClaudioZandonella avatar Apr 06 '22 07:04 ClaudioZandonella

I took a qmd file for a round trip through google drive and everything seemed to work fine. Many thanks

I think the authentication problem may be because I had not clicked on the right button after the warning screens, I was getting a 403 error. I ran googledrive::drive_auth() and was able to go through the process again and everything was happy.

With trackdown::dowload_file() I ran into a curl error

gnutls_handshake() failed: An unexpected TLS packet was received.

This resolved itself after a few attempts so not sure what went wrong there

richardjtelford avatar Apr 06 '22 13:04 richardjtelford

NEWS.md mentions Quarto is supported as of version 1.4.0?

krlmlr avatar Mar 30 '23 07:03 krlmlr

Quarto is now supported🎉

ClaudioZandonella avatar May 28 '23 22:05 ClaudioZandonella

Hi! I am having trouble using trackdown with quarto. My authentication worked easily, but when I run trackdown::upload_file(file = "manuscript.qmd", gfile = "manuscript"), I get the error "Error: manuscript.qmd not supported file type (only .Rmd or .Rnw)".

Is quarto no longer supported, or am I doing something wrong?

Edited to add: I initially tried downloading the quarto dev branch as described above but it was no longer available, and since you later said that quarto was supported, I figured I'd go ahead and try it.

kaijagahm avatar Apr 17 '24 22:04 kaijagahm

@kaijagahm

Quarto is supported by the version of trackdown on github. You can install the it with

remotes::install_github("claudiozandonella/trackdown", build_vignettes = TRUE)

richardjtelford avatar Apr 20 '24 08:04 richardjtelford

Thanks @richardjtelford! I downloaded the github version. Unfortunately, Google is now blocking me from authenticating the app. It says "This app tried to access sensitive info in your Google Account. To keep your account safe, Google blocked this access." I tried toggling on "allow less secure apps," but to no avail.

It's possible this is a feature of my school's google accounts, but I'm going to re-try and make sure that this authentication trouble is indeed a difference between the Github and non-Github versions.

kaijagahm avatar Apr 23 '24 17:04 kaijagahm

@kaijagahm

Apparently trackdown has reached the maximum number of users on its current credential (see https://claudiozandonella.github.io/trackdown/).

It is possible to set up your own google configuration. I've done this. It wasn't the most fun way to spend time, but I got it working - see https://claudiozandonella.github.io/trackdown/articles/oauth-client-configuration.html for instructions

richardjtelford avatar May 02 '24 17:05 richardjtelford