### In what scenarios do you need this feature? 目前在导出 PDF 的时候,主题的 css 样式是生效的。 但是插件的样式却不能生效。 ### Describe the optimal solution 希望插件的样式在导出的时候同样生效。 ### Describe the candidate solution _No response_ ### Other information _No response_
Activity
terwer commentedon Oct 9, 2023
+1
royc01 commentedon Oct 9, 2023
+1
Vanessa219 commentedon Oct 9, 2023
还麻烦举例详述一下。
frostime commentedon Oct 9, 2023
1. link icon 插件在思源中可以显示 url 的图标,但是导出 PDF 后就没有图标了
2. savor 有一个 callout 样式的功能,这个样式我同样抽离成了一个插件 sy-bq-callout,代码基本是一致的,还没有上架
但是使用 savor 主题导出的时候,callout 样式在PDF中会保留;使用插件的时候,PDF导出里面就没有对应的样式。
savor 可以导出:

但是插件就不能导出
Zuoqiu-Yingyi commentedon Oct 9, 2023
代码片段样式也有同样的需求
Vanessa219 commentedon Oct 9, 2023
看了一下,由于 PDF 是单独的静态页面,目前没办法引用插件。但是代码片段是可以添加的。
frostime commentedon Oct 9, 2023
请问同样是插入到 head 的 style 标签里,代码片段的css和插件的css有什么区别呢?
还是说导出 PDF 时不是从 head 当中读取 style 样式,而是根据特定的接口获取代码片段 css?如果是这样的话,是否可以给插件提供一个类似 addStyle 的接口,允许插件传入 css 字符串,让其在导出的时候生效?
Zuoqiu-Yingyi commentedon Oct 9, 2023
这里是指引用插件的 index.css
Vanessa219 commentedon Oct 10, 2023
@frostime
link-icon 这个没细看,里面好像是有 js 代码的,如果只加在 css 就可以了话那应该是没有问题的。
frostime commentedon Oct 10, 2023
只需要让 style 里面的 css 生效就行,至于 js 操作的样式可以不用管。
[-]让插件样式在导出 PDF 的时候同样生效[/-][+]Add plugin CSS and custom CSS to the export PDF page[/+]🎨 #9376
8 remaining items