We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://rmarkdown.rstudio.com/docs/reference/convert_ipynb.html
The text was updated successfully, but these errors were encountered:
rmarkdwon:::convert_ipynb doesn't read title and other tags from the metadata, which it's where we could add the information.
rmarkdwon:::convert_ipynb
On way to do that is by overwriting their ipynb_yaml function. In a hacky way we can do it as:
ipynb_yaml
nb_file <- "sample.ipynb" library('rmarkdown') ipynb_yaml <- function(meta, input) { # default title and output format res <- list( title = paste0('This is mine "', input, '"'), output = 'html_document' ) # currently only the `authors` field is supported authors <- unlist(lapply(meta$authors, `[[`, 'name')) if (length(authors) > 0) res[['author']] <- paste(authors, collapse = ', ') gsub('\n+$', '', yaml::as.yaml(res)) } assignInNamespace("ipynb_yaml", ipynb_yaml, "rmarkdown",) nb_rmd = rmarkdown:::convert_ipynb(nb_file)
And calling this file (ipynb2Rmd.R) as:
ipynb2Rmd.R
Rscript ipynb2Rmd.R
Will show that the output title is not their default. We then need to update the code to read other tags in the metadata.
Sorry, something went wrong.
This doesn't seem relevant anymore so closing.
No branches or pull requests
https://rmarkdown.rstudio.com/docs/reference/convert_ipynb.html
The text was updated successfully, but these errors were encountered: