Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这个插件可以让思源笔记显示效果有质的飞跃,建议b站录制教程,同时分享几个常用SQL模板 #9

Open
clark874 opened this issue Feb 21, 2022 · 7 comments

Comments

@clark874
Copy link

如题,使用过程中深深感觉这个插件潜力无穷,但太过硬核,对非程序员出身用户不太友好,且设置繁琐。
建议b站录制教程视频,同时分享几个常用简单的SQL模板,供小白用户参考。
再次感谢作者!

@xxhh12a
Copy link

xxhh12a commented Mar 13, 2022

我甚至想要图形化界面,呜呜呜

@Zuoqiu-Yingyi
Copy link
Owner

@xxhh12a 我前端水平太菜了o(╥﹏╥)o

@ttimasdf
Copy link

看了好几遍,还是没看懂……建议多补充几个例子。

@ttimasdf
Copy link

ttimasdf commented Mar 23, 2022

可以看出作者想补全思源在SQL这块缺少的定制化功能,但是想法太多的时候,一定要捋清楚,文档里定义了很多名词,但在文档里都没有解释,

我建议作者补全的解释:

  1. 普通模式,与 自定义模式,区别,与 demo
  2. 模板字段,模板放在哪儿(select 后面?),是否需要加双引号,
  3. “模板”里的 prefix,field,如果这俩都是用户需要填入的值,可以写成 .<prefix>{.<field>},这样别人一眼就能看出来是变量
  4. 字段别名是啥?alias 和 field 是一个东西么?完整的写法到底是什么?最好给个 demo

还有中文英文的文档放在一起——至少我感觉——可读性比较差……两种语言之间有时候用 | 隔开,有时候又用回车隔开,会让人费解这到底是一个变量的两个定义方法,还是单纯的一个东西写了两遍。我觉得看用户群体,其实写中文就好。能接触到这个软件的人肯定不会有语言障碍。。

思源和一般项目有一点不一样,它不开源,还是个纯黑盒,还没console,用户会非常非常依赖文档,因为一旦出错了只能人脑依据文档debug SQL语句,说不定还得看代码。没文档……确实很难上手

@ttimasdf
Copy link

ttimasdf commented Mar 24, 2022

补充个普通模式渲染的例子,可以一键生成 TOC,底下的 .action{.id} 是模板的语法,可替换成具体ID。不过我对插件做了一点修改,

  1. 加了个 __hidden__ 修饰符,字段可以从数据库读而不显示在页面上 6a227d5
  2. 加了个选项,可选关掉了第一列序列号的显示 afa80e3
  3. 加了个选项,可以选择将表格插入到挂件按钮的前面还是后面 3ecefc3

因为我还加了一些其他方便自用的修改,这些修改就不提 PR 了,不过都在 feat-noindex-hidden 分支上。

SELECT content as __hidden__content, id as __ref__文档名 FROM blocks WHERE type = 'd' and path like '%.action{.id}%' and root_id != '.action{.id}'

image

@Zuoqiu-Yingyi
Copy link
Owner

@all-contributors please add @ttimasdf for ideas code

@allcontributors
Copy link
Contributor

@Zuoqiu-Yingyi

I've put up a pull request to add @ttimasdf! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants