【问题标题】:Publishing a RevealJS presentation to RStudio Connect with plugins?使用插件将 RevealJS 演示文稿发布到 RStudio Connect?
【发布时间】:2021-06-30 03:03:08
【问题描述】:

我使用 JJ Allaire 的revealjs 包(版本 0.9)开发了演示文稿,在 RStudio IDE(版本 1.4.1103.4,平台:x86_64-redhat-linux-gnu(64 位),R 版本 3.6.0)中没有问题。但是,如果我添加插件,在使用源代码发布到 RStudio Connect 时出现以下错误。

Error in (function (incremental = FALSE, center = FALSE, slide_level = 2, :
04/03 14:25:02.921 (GMT)
Using reveal_plugins requires self_contained: false
04/03 14:25:02.921 (GMT)
Calls: local ... <Anonymous> -> create_output_format -> do.call -> <Anonymous>

incrementalself-contained 的值在我的 YAML 中分别设置为 TRUE 和 FALSE,因此该错误对我来说没有意义。看来我有两个成功发布的选择:

  1. 有插件,但没有源代码
  2. 有源代码,但没有插件

我在下面提供了一个简单的源代码示例。

---
title: "My Title"
author: "Author Name"
date:  "`r Sys.Date()`"
output:
  revealjs::revealjs_presentation:
    incremental: true
    self_contained: false
    reveal_plugins: ["notes", "chalkboard", "menu"]
link-citations: yes
---

## Slide 1

- Bullet 1
- Bullet 2

我真的很喜欢revealjs,但我很困惑。非常感谢任何帮助。

【问题讨论】:

  • 我要么在revealjs repo上提交一个GH问题,要么联系Rstudio支持,因为你是客户。
  • 感谢您的评论。我已经创建了一个 GH 问题,并将报告我学到的任何东西。

标签: r slideshow web-publishing


【解决方案1】:

回复我收到的(转述的)答案,以回应我在此处发布的 GH 问题:https://github.com/rstudio/revealjs/issues/86

图片来源:Christoph Dervieux

问题在于 RStudio Connect 如何处理 YAML 标头中 self_contained 选项上的 revealjs 约束。

使用插件时,self_contained 必须设置为FALSE。但是,RStudio Connect 在发布到服务器时强制执行 self_contained: true。 RStudio Connect 将在服务器上呈现文档,而无需提及它还覆盖了 Markdown 的 YAML 标头中的 self_contained 设置,在幕后将 self_contained: FALSE 更改为 self_contained: TRUE。这解释了为什么插件在本地工作,但在发布到服务器时不能工作。

建议的解决方法是在本地服务器上构建幻灯片,然后发布文件夹和文件(HTML + 资源),而不是让 RStudio Connect 尝试渲染 markdown。

p>

目前,我很高兴使用插件在本地渲染我的幻灯片。将添加带有任何新信息的评论。但目前看来,这个问题已经得到解答。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-17
    • 2023-01-13
    • 2017-03-14
    相关资源
    最近更新 更多