简体   繁体   English

Bookdown (gitbook) 生成空的 HTML

[英]Bookdown (gitbook) produces empty HTML

I am currently working on a book which I want to knit into a GitBook.我目前正在写一本书,我想将它编入 GitBook。

Yesterday the output looked amazing (thanks to bookdown).昨天的输出看起来很棒(感谢 bookdown)。

Today, I modified just the simplest content of my book and tried to knit it again.今天,我只修改了我书中最简单的内容,并尝试再次编织它。 All resulting HTML-files were empty, except for the index.html .除了index.html之外,所有生成的 HTML 文件都是空的。

The same issue arises when I want to run the minimal-book-example .当我想运行minimum-book-example时会出现同样的问题。 Just to demonstrate, not even this small example is working:只是为了演示,即使是这个小例子也不起作用:

index.rmd索引.rmd

--- 
title: "Very small example"
site: bookdown::bookdown_site
output: bookdown::gitbook
documentclass: book
description: "to demonstrate my problem"
---
# Well, I'm stuck.

01-ChapterOne.rmd 01-ChapterOne.rmd

# Chapter One
Could anyone

02-ChapterTwo.rmd 02-ChapterTwo.rmd

# Chapter Two
please help me?

I do not receive any error messages, making it very hard to troubleshoot on my own.我没有收到任何错误消息,因此很难自行排除故障。 Also, the sidebar portrays the content of the book (all chaptes and subchapters) correctly.此外,侧边栏正确地描绘了本书的内容(所有章节和子章节)。 However, if you click on them, they are empty.但是,如果您单击它们,它们是空的。

OS: Ubuntu 20.04 LTS操作系统: Ubuntu 20.04 LTS

R version: 3.6.3 (2020-02-29) R 版本: 3.6.3 (2020-02-29)

RStudio version: 1.3.1073 RStudio 版本: 1.3.1073

bookdown version: 0.20.6预订版本: 0.20.6

The same (or a similar) issue was raised here but unfortunately, no solutions were found. 此处提出了相同(或类似)的问题,但不幸的是,没有找到解决方案。

Any help is greatly appreciated and thank you in advance!非常感谢任何帮助,并在此先感谢您!

I think you use the kntir button in RStudio.我认为您在 RStudio 中使用了 kntir 按钮。 This will just render the index.Rmd (when it is the current opened document).这只会呈现 index.Rmd (当它是当前打开的文档时)。

From the console you have to use: bookdown::render_book('index.Rmd', 'bookdown::gitbook') or you use the build button in RStudio:从控制台你必须使用: bookdown::render_book('index.Rmd', 'bookdown::gitbook')或者你使用 RStudio 中的build按钮:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM