我该如何解决这个问题呢?我在*.rmd文件中添加了以下代码行:
DiagrammeR::mermaid("
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me
")我使用R包蒸馏来编织一个distill_website。只有路程图不会生成。我可以在html文件中看到一个空格,但没有图符。
发布于 2021-04-03 19:26:20
您可以从使用devtools包从GitHub安装DiagrammeR的开发版本开始,并查看不同之处:
devtools::install_github("rich-iannone/DiagrammeR")看起来Journey Diagram还没有实现。
因此,对于快速(和临时)解决方案(与distill::distill_article完美配合),您可以
在没有捆绑器的情况下,你可以在
中插入一个带有绝对地址的
script标签和一个mermaidAPI调用,如下所示:
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad:true});</script>
```{r diagram-mermaid, echo = FALSE}图::美人鱼(图=‘
旅程
title My working daysection Go to work Make tea: 5: Me Go upstairs: 3: Me Do work: 1: Me, Catsection Go home Go downstairs: 5: Me Sit down: 5: Me',高度= '100%',宽度= '100%')
这样做将命令美人鱼解析器使用
class="mermaid"查找<div>标记。从这些标记中,美人鱼将尝试读取图表/图表定义,并将其呈现为svg图表。
这对distill::distill_website有什么帮助吗?
https://stackoverflow.com/questions/66907950
复制相似问题