Zuoqiu-Yingyi / widget-query

一个将思源笔记数据库查询结果以表格样式渲染的挂件 | A widget that renders the query results of the Siyuan Notes database in tabular style.
GNU Affero General Public License v3.0
55 stars 7 forks source link

表格中能显示图片吗 #32

Closed Chenm4 closed 2 years ago

Chenm4 commented 2 years ago

我如果在asset表中查询图片能有办法显示吗,我看它只显示path

Zuoqiu-Yingyi commented 2 years ago

可以, 下面是一个示例, 功能为随机显示一张图片的引用路径与图片预览:

SELECT
    a.path AS __1____raw__图片引用路径,
    '![' || a.name || '](' || a.path || ' "'|| a.title || '")' AS __2____pre__图片预览
FROM
    assets AS a
ORDER BY random()
LIMIT 1;