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
What do you want to do with plugins? #375
Comments
A bunch of plugin ideas:
|
关于插件机制,提几点建议
|
@stefnotch This feature maybe will support in the next version natively.(not in plugin). |
支持更多的文本格式?这是指支持更多的markdown 语法(标准和非标准的)吗?正如你下面说的,这个需要去扩展marked,我问了marked 维护者,他们暂时还没有支持 plugin 的打算,如果我们去做的话,和你理解的一样,需要考虑 marktext 在编辑器内部的渲染不是依赖 marked的,是通过snabbdom 来进行渲染的,所以其是marked 只是提供了block 的解析(不包含inline语法)以及输出markdown 时候会用到(包含block 和 inline 语法)。 非常感谢你开分支,也真挚希望你为 marktext 贡献一份力量,有任何代码可优化的地方,以及问题都可以联系我?
正如上面所说,我也有这方面的打算,这样就能够更加方面的扩展markdown 语法,当然这不属于marktext 的插件,而应该是 muya 的插件。
正如上面所说,marktext 的渲染是通过 snabbdom 来负责的,所以这个应该和插件没有太大关系,但是css 模块化管理更有利于维护。
|
第1点的意思跟marked无关。我是说marktext目前仅是一个markdown编辑器,但如果规划良好(实际已经完成了80%的工作),很容易做所有mark语言的编辑器,markdown仅是mark语言的一种,其它仅github就提供reStructedText,Textile等上十种格式,在实际应用中其它行业与公司也有自用的mark语言,marktext核心可专注 markdown,但提供接口让其它人进行扩展,类似以下这种方案,因为仅是示例,载图也仓促,见谅。 编辑器为每种文件格式配置一个设置文件,比如 |
@rainfu 我大概明白你的意思了,这需要去调研下相关 mark 语言的语法。你有这有的列表吗 |
第3点我理解的是既然每个标记都已经得到解析,那么sourcecode模式以 snabbdom 解析的话实际就是换个class的模型,比如 h2在常规模式的class类同html,在sourcecode模式下将样式变化为codemirror指定的高亮语法,因为没研究codemirror,这点不知我理解的对不对,。 |
@Jocs 本项目wiki页,在新建一个wiki的时候会有个编辑器其中包含一个 mark标记语言列表,实际上你不需要知道别人怎么实现他们,你只需要提供一个接口,象codemirror那样让用户有清晰的扩展动机,主版本更新也不会影响他们的代码即可。 |
@rainfu 你的理解是对的,只需要对 sourcecode mode 重写一套渲染,但不是简简单单改CSS,比如图片,在 realtime mode 下回实时渲染图片出来,在 sourcecode mode 下面就不会渲染 img 标签。重写一套渲染有个好处就是,可以很好地控制,比如可以添加插入图片、搜索等功能。也能更好的做到 realtime 和 sourcecode 切换时光标的保持位置不变。 |
能不能开个plugin的分支,我会做些尝试工作,因为现在合并到master不太现实,对核心代码的更攻需要与你反复的沟通与优化,目前来讲也不宜太激进 我想可以这样,
|
@rainfu 你可以先在自己的仓库实践一下你的方案,我也可以直接到你 fork 的仓库看代码,等最终确定方案了,就可以开始开一个分支插件分支了 |
我已经提交了一部分实验代码,代码位置:https://github.com/rainfu/marktext/tree/develop 目标仍旧是希望marktext通过插件化实现多文件格式支持,插件易于第三方扩展。目前完成菜单相关部分的内容 菜单相关
文件格式相关这一部分处于探索阶段,,目前对可能处理的核心parser做了些标记,对多文件格式支持的plugin做了些规划,规划的plugins分为二级目录,包括 mime,block,inline,cloud等子目录,minimajs也需要做些扩展工作,已提交至作者处,希望你研究一下这个预案是否可行,会触到什么雷,3ks。 |
Export to Gmail DraftUsing marktext to copy/paste as html into other web apps is super nice. Sadly sometimes other web apps like Gmail do not allow pasting html into their mail editor. In case of Gmail i found no simple solution to this problem without using bloated chrome extension or cloud services. Gmail ApiWith google's gmail api and nodejs client lib [github] [npm] one could easily develop a plugin to create a draft from marktext. Export PluginsSpecifically export plugins could improve working with markdown drastically. Even if other web apps accept copy/paste html, an export could speed up and improve the experience. Like |
@MarcusSpecht Very good idea, exporting to gmail is also very suitable for plugins. When designing the plugin system, I will take this usage scenario into consideration, and also provide plugin APIs and examples. |
@MarcusSpecht We also need the help of the designer, because we feel that marktext can be greatly improved in terms of interactive experience and appearance. |
I would add a plugin to color text, maybe something like: This text can be color(#42c8f4)(colored blue perhaps) |
Maybe we could have an inline youtube embedder as well 🤤 Really take markdown to the next level. |
@saivan But GFM or CommonMark Spec do not support |
Well, it depends on the spec, sure - but pandoc's spec supports html tags inline. So colored text could be achieved with a span tag with a css attribute set haha. But isn't the whole point of a plugin to enable us to add functionality that we might want for ourselves? |
Academia plugin Most academic publications have a rather similar format.
A plugin could provide a number of those features to make creating |
Haha academic publications are |
@BoostIO funded this issue with $10. See it on IssueHunt |
支持程序运行的plugin?如果太外行还请勿怪。。不知道这不是插件的工作范畴。 比如说支持python或者R。在代码chunk多一个运行按钮,然后就能在编辑器内书写和运行代码示例。 |
@kmsmgsh 运行代码的功能确实不错?但是在markdown 编辑器中是用的多吗? |
@Jocs 多不多我不敢下结论,但是可以在以下环节使用: 现有工具:我个人知道的还是以语言工具为主,python的jupyter notebook和R 的R markdown。 p.s. 对于我个人最想要的功能还是基于bibtex的参考文献功能,拿markdown写文献综述和算法说明(以及论文)比用latex爽很多!但是这个功能前面的大哥有提过所以就不重复提啦。。 |
@issuehuntfest has funded $20.00 to this issue. See it on IssueHunt |
Is there any chance this will ever be possible? It seems like from #1390 and others that javascript is disabled in html blocks, but it would really be useful if we can have some way to do a plugin or something so that we can do user defined things, for instance read csv file into table or whatever. I understand theres probably some security issues to this but at least if you are given an option to do it at your own risk then it seems reasonable |
@grahamannett The plugin we are talking about may not be executing JavaScript code in the html block. Instead, we will install a plugin package to enhance the functionality of Mark Text. Any issue involving an XSS attack may not be easy to let go. |
a simple drawing plugin would be perfect... |
and the possibility to customise the passing process, would be helpful in a plug-in system.
|
the special sequences should allow variable placeholders
is used in some markdown editors. with the above plugin proposal one could simply return a DOM element with the image of the appropriate size. The registration for the plugin |
by the way, nice work, your plans of going international are working, marktext reached Germany ;) |
This: #549 - Support relative image directory 😄
And Russia too 😉 |
Planning ahead for plugin support is definitely wise. It ensures that a clean interface is available for plugin development to begin. Regarding earlier comments, I offer the following two observations:
Considering the above, it would be valuable to move toward a well-planned plugin interface that includes flexible support for both different backend storage types and further extensions to the Markdown language. |
Some kind of plugin interface to hook into markdown would be handy. There is an issue with an ongoing discussion about the solution. From the usability side I could imagine:
|
I am wondering if there is an API for customizing the sidebar? |
I know that custom themes have been requested, but some simple tweaks to the current themes would also be appreciated. For instance, Another plugin that would be super useful is a table of content generator, which is implemented in other Markdown editors (see https://stackoverflow.com/questions/11948245/markdown-to-create-pages-and-table-of-contents). Basically, all headers would be gathered and hyperlinked into a table of contents at the top of the file. |
A plugin that automatically creates a table of contents for a file would be really nice. You could use something like markdown-toc to accomplish this probably. |
Being curently in the process of writing a screenplay, I can tell you that MarkText has a good potential to being a simple screenplay writing ecosystem - currently domiated a lot by propreitary softwares. That would probably be features as :
If a plugin architecture is realeased, I'll see if my little development skills are enough to develop a tool like this 😃 |
The main editor should be able to be used as a LOCAL editor. all the uploading and downloading features should be moved into the plug-in as optional features. |
I agree with the sense of the comment given by @NewUserHa, that the core application currently carries a great deal of bloat, much of it for connection to specific services. Moving service-specific functionality to extensions, and leaving the core application to handle standard formatting features, may be a wise strategy. |
Describe your feature request What problem does this feature solve? [optional] 这是uPIC的官网:https://blog.svend.cc/upic/ |
Would it be possible to support excalidraw drawings like Obisidian does? |
I'd be very interested writing a plugin that adds some basic knowledge base features such as |
Hi. Have You considering using Obsidian API (possibly: https://github.com/obsidianmd/obsidian-api)? I imagine it may require some work and probably also creating some "dummy" methods or classes for example, but this way quite a lot of Obsidian plugins could be available right away. And I think quite a lot of them are published under MIT license. And, by the way, thank You for all Your work and all put into this project! |
Hi @kmsmgsh @grahamannett , do you still care about script execution in markdown? We feel the same and already have a demo at https://union.anyscript.dev/. We want to make it a pluggable markdown editor in the future but would love to have a conversation to gain more insights. And here's my proposal |
Hi, everyone
Because of love of markdown, I usually likes to write some documents or technical blog. Therefore, I decided to write a markdown editor. The first thing I planned to do was write an editor for myself use. By the way, open sourced to GitHub. Mark Text has received more and more attention, with more feature requests, in order to meet these needs, I began to do some more in-depth thinking on Mark Text, such as support for different editing modes, customized settings, auto-completion of picture paths, etc.
The 0.12.25 version was recently released, with support for sidebars and tabs, which makes it easier to edit projects and search for keywords in projects.
As the new functional requirements will always appear, the marktext volume (code size) will also become larger and larger. After the 1.0 release, we consider supporting plug-in so that we can write our own plug-ins to achieve the functions we want.. such as:
Of course, there are still many functions that plug-ins can implement. We also hope that everyone can provide some ideas or what do you want to use plug-ins to do something? This also makes it easier for us to better design plug-in APIs.
Finally, everyone is welcome to download Mark Text and experience it, although it is not yet perfect.
The text was updated successfully, but these errors were encountered: