Comments (4)
同理,希望能把思源里的块设计为单独的class,然后通过类方法来实现该类块的操作,
比如 以列表块为例,实现上述的功能
let para_element= <获取当前光标下的NodeParagraph元素>
let list_element= <获取相邻块的NodeList元素>
//把段落转换为list item
let listitem=SYList.createListItem(para_element)
// 以html元素为参数,实例化一个列表对象
let listObj=new SYList(list_element)
//将list item插入到列表结尾
listObj.appendChild(listitem)
from petal.
可以用 Lute 来创建空列表,自己封装一下吧。
from petal.
@Vanessa219 解决了, 插件可以用lute很nice
遗憾之一就是没文档,源码(petal)里也没对API作用的注释, 我是看了siyuan项目的源码才知道
from petal.
哈哈,有空可以 PR 下
from petal.
Related Issues (14)
- Meeting 2023.4.15 HOT 1
- load.js 文件地址替换,gitee 需要登录才能访问,会导致加载失败 HOT 1
- Move the plugin system entry to the marketplace
- FileApi 兼容性移除
- 迁移老商店上的插件 HOT 1
- API 框架和代理实例
- 插件注册的快捷键被macOS组合输入干扰
- Add protyle to the Protyle class
- Add some `Protyle` methods to the plugin API HOT 5
- 打开插件管理页面速度太慢 HOT 3
- Improve Global.Lute type HOT 2
- Update `Dialog`
- Add `dialog` object to `Setting` property HOT 3
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 petal.