Giter Club home page Giter Club logo

Comments (4)

iamqiz avatar iamqiz commented on May 26, 2024

同理,希望能把思源里的块设计为单独的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.

Vanessa219 avatar Vanessa219 commented on May 26, 2024

可以用 Lute 来创建空列表,自己封装一下吧。

from petal.

iamqiz avatar iamqiz commented on May 26, 2024

@Vanessa219 解决了, 插件可以用lute很nice
遗憾之一就是没文档,源码(petal)里也没对API作用的注释, 我是看了siyuan项目的源码才知道

from petal.

Vanessa219 avatar Vanessa219 commented on May 26, 2024

哈哈,有空可以 PR 下

from petal.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.