简体   繁体   English

主机 R bookdown 在 sharepoint 上生成 gitbook 的问题

[英]Issue with Host R bookdown generated gitbook on sharepoint

I am trying to establish a workflow to host bookdown generated gitbook on Sharepoint (main content publishing platform within corporate).我正在尝试建立一个工作流程来在 Sharepoint(公司内的主要内容发布平台)上托管 bookdown 生成的 gitbook。 With some tweaks, we can the gitbook on the sharepoint and have no issues with embedded ploty figures.通过一些调整,我们可以在 sharepoint 上使用 gitbook,并且嵌入的绘图数字没有问题。

However, all the figures saved on sub folders could not be displayed.但是,无法显示子文件夹中保存的所有图形。 It was found that SharePoint added "_" to the "_main_files" automatically as "files" was reserved for system.发现 SharePoint 自动在“_main_files”中添加了“_”,因为“files”是为系统保留的。

There is some option within _bookdown.yml to config the outputdir such as output_dir: "Outputfolder". _bookdown.yml 中有一些选项可以配置输出目录,例如 output_dir: "Outputfolder"。 However, the "_files" is still automatically added for the folder that saves image.但是,仍会为保存图像的文件夹自动添加“_files”。

Is there a work around with bookdown config to change the sub-directory ?是否可以使用 bookdown 配置来更改子目录 A folder name like "_main_images" would not conflict with sharepoint naming convention.像“_main_images”这样的文件夹名称不会与共享点命名约定冲突。

You can set the figure path using the knitr chunk option fig.path in the first code chunk of your book, eg,您可以在本书的第一个代码块中使用knitr块选项fig.path设置图形路径,例如,

```{r include=FALSE}
knitr::opts_chunk$set(fig.path = '_main_images/')
```

I'm not entirely sure about the consequences of changing the default fig.path , but if your book only contains R plots and no HTML widgets, this change should be fine.我不完全确定更改默认fig.path的后果,但如果您的书仅包含 R 绘图而没有 HTML 小部件,则此更改应该没问题。

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

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