Comments (19)
https://github.com/justice2001/halo-plugin-vditor/blob/dev/doc/rfc/custom-insert.md
第一次搞这种需求,写了个设计方案,您可以看一下能否满足要求,或者有什么比较好的意见,可以交流一下。
from halo-plugin-vditor.
谢谢支持,您是指的让主题开发者或用户能使用自定义块来解析自己的语法嘛,还是说支持在toolbar插入自定义的按钮来处理行为呢。
from halo-plugin-vditor.
插入自定义按钮,主题或者用户有时候会有一些做一些自定义标签来方便使用,就像Joe3中就有很多类似于<joe-progress percentage="50%" color="#6ce766"></joe-progress>
的自定义标签,如果能在编辑器快速插入就方便很多。
就类似于现在的插入自定义块。
from halo-plugin-vditor.
看起来非常好,更细节的问题,可能得等初版之后才能知道。
from halo-plugin-vditor.
OK,那我就先按照这个方案实现了
from halo-plugin-vditor.
搓了一个版本出来,基本能够使用了。现在的版本需要手动去填写配置文件的地址,还做不到自动寻找配置。插入现在支持模版配置。还有点bug没解决完。
这是ci的链接:
https://git.mczhengyi.top/zhengyi/halo-plugin-vditor/actions/runs/41
from halo-plugin-vditor.
这是实现的效果
from halo-plugin-vditor.
初步测试来看是可以满足需求的,现在是支持formkit的所有类型表单吗?如果是,select
类型的输入的表达应该是怎么设计呢?,刚才试了下下面这个写法,似乎是错误的,直接不显示了。
from halo-plugin-vditor.
options的语法是:
"options": {
"value": "label",
"value2": "label2"
}
https://formkit.com/inputs/select#value-label-object
from halo-plugin-vditor.
好的,是我漏看了,非常感谢!!!
from halo-plugin-vditor.
现在使用没有什么大问题了,发现了下面一些小问题。
现在在所见即所得下后面是直接隐藏的。
在分屏模式下,插入后,发布后自定义标签会丢失。 下面是我的设置
{
"type": "template",
"id": "joe-cloud",
"icon": "",
"name": "网盘资源",
"formKit": [
{
"$formkit": "select",
"name": "cloud-type",
"label": "云盘类型",
"help": "Choose the type of cloud service.",
"value": "default",
"options": [
{"label": "默认网盘", "value": "default"},
{"label": "百度网盘", "value": "bd"},
{"label": "阿里网盘", "value": "ad"},
{"label": "蓝奏云网盘", "value": "lz"},
{"label": "微云网盘", "value": "wy"},
{"label": "Github仓库", "value": "github"},
{"label": "Gitee仓库", "value": "gitee"}
]
},
{
"$formkit": "text",
"name": "cloud-title",
"label": "网盘名称",
"help": "留空则显示默认标题"
},
{
"$formkit": "url",
"name": "cloud-url",
"label": "跳转链接",
"help": "网盘链接地址",
"value": ""
},
{
"$formkit": "text",
"name": "cloud-password",
"label": "密码",
"help": "网盘的访问密码,无则留空",
"value": ""
}
],
"template": "<joe-cloud type=\"$cloud-type$\" url=\"$cloud-url$\" password=\"$cloud-password$\" title=\"$cloud-title$\"></joe-cloud>"
}
from halo-plugin-vditor.
from halo-plugin-vditor.
这个问题的原因应该和上面是一致的,现在正在修复
from halo-plugin-vditor.
在分屏模式下,插入后,发布后自定义标签会丢失。 下面是我的设置
这个问题应该已经完成修复。
现在在所见即所得下后面是直接隐藏的。
这个问题是由于Vditor本身特性所导致的,但我在设置里面加入了一个选项,可以让HTML代码块不再隐藏。
同时我加入了一个注入脚本的配置,这个功能可以在编辑器初始化时加载js脚本和样式表文件,可以用于自定义块的实时渲染。
配置格式:https://github.com/justice2001/halo-plugin-vditor/blob/dev/doc/rfc/custom-insert.md
最新的CI构建: https://git.mczhengyi.top/zhengyi/halo-plugin-vditor/actions/runs/42
from halo-plugin-vditor.
这是实现的效果:
from halo-plugin-vditor.
更新插件之后,已经出现的新的按钮,但是开启后,效果和上个版本插件没有太大区别,在插入分栏插入网盘块的时候,还是会消失,HTML代码,还是隐藏的,Halo2.11.3
from halo-plugin-vditor.
https://git.mczhengyi.top/zhengyi/halo-plugin-vditor/actions/runs/44
这个版本应该是可用的,可能halo对同版本号的插件处理有些问题,我修改了下版本就可用了。
from halo-plugin-vditor.
https://git.mczhengyi.top/zhengyi/halo-plugin-vditor/actions/runs/44
这个版本应该是可用的,可能halo对同版本号的插件处理有些问题,我修改了下版本就可用了。
现在 Halo 是把所有的插件资源捆绑在一起的,并使用 name+version 的 hash 作为缓存 key,如果更新插件之后版本号不变,那么捆绑资源的缓存 key 就不会变,会导致依旧使用旧的资源。
from halo-plugin-vditor.
好的,那我后续在开发版本中在版本号里加入构建号标识应该就可以了。
from halo-plugin-vditor.
Related Issues (20)
- 更新之后暗色模式异常 HOT 4
- 建议为静态资源添加版本号参数
- 编辑已发布文章的内容,只更改图片链接,不更改文章文字内容,点发布,提示发布成功,但实际不会保存新图片链接 HOT 2
- 添加自定义语法的能力 HOT 1
- 关于行内公式渲染等问题 HOT 1
- “Tips” 样式会影响 Hao 主题其他页面样式 HOT 2
- 对于PJAX支持不完善的问题 HOT 3
- Halo Vditor 编辑器 更新到1.60后报错 HOT 3
- 单页文章加载Vditor资源时 version 未成功替换问题 HOT 1
- plantUML 无法渲染 HOT 1
- setDarkMode is not defined & 媒体无法正常渲染 HOT 1
- 提供替换jsdelivr的设置选项 HOT 2
- 关于嵌入iframe等资源不能正常加载的问题 HOT 3
- 多媒体无法正常渲染 HOT 4
- 能否支持编辑时的 Title自动设置为文章的Title? HOT 16
- 能否支持更多主题? HOT 6
- 支持 <<文章限制阅读 Pro>> 插件吗?
- 支持默认选择某个编辑模式? HOT 1
- markdown解析异常 HOT 3
- 各语言代码块中的字体颜色和背景色对比度不明显,字体看不清楚 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from halo-plugin-vditor.