-
-
Save noamross/58f9f0af0c3215a18d14128ccce82413 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(googledrive) | |
gdoc_to_md <- function(file, path=NULL, markdown="markdown") { | |
td <- tempdir() | |
gf <- googledrive::drive_download( | |
file, path = td, | |
type = "application/epub+zip", overwrite = TRUE | |
) | |
if (is.null(path)) { | |
path <- file.path(getwd(), paste0(gf$name, ".md")) | |
} | |
rmarkdown::pandoc_convert( | |
input = gf$local_path, | |
to = markdown,i | |
from = "epub", output = path | |
) | |
# Add function or pandoc filter ot to clean URLs | |
} | |
gdoc_to_md(as_id("https://docs.google.com/document/d/1mr7WLlJmsnN2C_iKT1vBVgMlYgFJZDK6dLthbJu3ofM/edit#")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment