Skip to contents

Transform Google Doc to Quarto book

Usage

quartificate(gdoc_id, path, render = FALSE, fix_lists = FALSE)

Arguments

gdoc_id

ID of the Google Document.

path

A path, where to create the Quarto book. It will be created if needed.

render

Logical. Whether to render the resulting Quarto book.

fix_lists

Logical. Whether to try and fix lists, see Details.

Value

Nothing.

Details

If your Google Document contains lists whose items span several lines, you might get better results with the fix_lists parameter set to TRUE. The problem is that in Google Docs lists, from the second line lines in items have a small indentation. Pandoc tends to interpret this as a blockquote. We try to fix that by merging blockquotes in their previous sibling, when that previous sibling is a list item.

Examples

id <- googledrive::drive_find(
    q = "name contains 'My Example Document'"
  )$id
#> Error in drive_auth(): Can't get Google credentials.
#>  Are you running googledrive in a non-interactive session? Consider:
#>  Call `drive_deauth()` to prevent the attempt to get credentials.
#>  Call `drive_auth()` directly with all necessary specifics.
#>  See gargle's "Non-interactive auth" vignette for more details:
#>  <https://gargle.r-lib.org/articles/non-interactive-auth.html>
 quarto_dir <- withr::local_tempdir()
 quartificate::quartificate(id, quarto_dir, render = TRUE)
#> Error: object 'id' not found