【问题标题】:how to use the "timeout" argument in Chrome_print in Pagedown如何在 Pagedown 的 Chrome_print 中使用 \"timeout\" 参数
【发布时间】:2022-11-27 01:36:36
【问题描述】:

由于 chrome_print arugment 没有以正确的语法方式使用,因此将下面的 YAML 标头与文件的其余部分一起使用空白,不会呈现。我怎样才能正确使用这个论点?

---
title: "A Multi-page HTML Document"
author: "Yihui Xie and Romain Lesur"
date: "`r Sys.Date()`"
output: pagedown::html_paged
knit: pagedown::chrome_print(timeout=50)
---

来自 Pagedown documentationhere 它讨论了使用 chrome_print() 使用无头 chrome 打印渲染文档......但我无法正确应用此参数来强制渲染过程超过默认的 30 秒。

尝试渲染时出现以下错误

syntax error near unexpected token `timeout=50'

谢谢!

【问题讨论】:

    标签: html google-chrome yaml r-markdown knitr


    【解决方案1】:

    试试这个方法,

    ---
    title: "A Multi-page HTML Document"
    author: "Yihui Xie and Romain Lesur"
    date: "`r Sys.Date()`"
    output: pagedown::html_paged
    knit: (function(inputFile, encoding) {
          pagedown::chrome_print(inputFile, 
                            encoding = encoding, 
                            timeout = 50)})
    ---
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-04
      • 2021-06-18
      • 2019-12-07
      • 1970-01-01
      相关资源
      最近更新 更多