我正在使用R中的bookdown
包来编写一个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
中的选项,以便在最终渲染中不显示共享选项吗?
谢谢! SN
答案 0 :(得分:1)
两个错误:
function isUserExists(query, callback) {
User.findOne(query, function(error, user) {
if(error) {
return callback(error);
}
callback(null, !!user);
});
}
function sendResponse(res, error, result) {
if(error) {
res.statusCode = 500;
log.error('Internal error(%d): %s', res.statusCode, err.message);
return res.json({error: 'Server error'});
}
if(!user) {
res.statusCode = 404;
return res.json({
error: 'Not found'
});
}
res.json(result);
}
router.get('/:id', function(req, res) {
isUserExists({emailAddress: req.params.id}, sendResponse.bind(null, res));
});
router.get('/username/:id', function(req, res) {
isUserExists({username: req.params.id}, sendResponse.bind(null, res));
});
; bookdown::gitbook
应为gitbook_config
。config