Created
March 1, 2018 14:57
-
-
Save noamross/17699c7b61ca52035d58a45eee54b5a2 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#"))4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment