1

我正在使用bookdownR 中的包来编写一个 gitbook,但我不希望最终的书有到 facebook、twitter 的共享链接。我在YAML

--- 
title: "A Minimal Book Example"
author: "SN"
date: "`r Sys.Date()`"
output: 
  bookdown::gitbook
    gitbook_config:
      sharing:
        facebook: false
        twitter: false
documentclass: book
link-citations: yes
description: "This book ... ."
---

但我收到一个错误

Error in yaml::yaml.load(enc2utf8(string), ...) : 
  Scanner error: mapping values are not allowed in this context at line 6, column 19
Calls: <Anonymous> ... yaml_load_utf8 -> mark_utf8 -> <Anonymous> -> .Call
Execution halted

谁能帮我设置选项,YAML以便在最终渲染中不显示共享选项?

谢谢!序列号

4

1 回答 1

3

两个错误:

  1. bookdown::gitbook您在;之后省略了一个冒号
  2. gitbook_config应该是config
--- 
title: "A Minimal Book Example"
author: "SN"
date: "`r Sys.Date()`"
output: 
  bookdown::gitbook:
    config:
      sharing:
        facebook: false
        twitter: false
documentclass: book
link-citations: yes
description: "This book ... ."
---
于 2016-05-21T06:01:31.003 回答