Discourse基础编辑器

I can see where you want to go. If I understand correctly you want to create a kind of full Editor with much more advanced functionality using html to give a much more complete experience.

I for one would love to see a WYSIWYG editor that preserves the markdown output. I am less concerned about being able to type in and have it interpret markdown; normal shortcuts like e.g. Ctrl-B (bold) are fine, or the toolbar. But I do want to preserve later editability, interpretation outside of a rendering context, and exportability. And HTML in my experience is problematic for at least some of it not all of that.

I am curious what specifically you are wanting the editor to do that is not compatible with markdown output?

Also I’ll point out that Typora does a pretty good job of handling rendering of markdown in-line as well as shortcuts, and I don’t see why a formatting bar couldn’t also work (though it doesn’t seem to have one).

5 个赞

How do I move the photo add button.

move

3 个赞

Hey @ozkn!

I’m working in a way which just imageUpload will be necessary! So, you could follow the same lead. In your initializer you could modifyClass of component:b-editor changing setubBasicEditor function.

api.modifyClass("component:b-editor", {
   setupBasicEditor(){
       loadScript("/plugins/DiscourseBasicEditor/ckeditor.js").then(() => {
           ClassicEditor.create( document.querySelector( '#editor' ), {
                toolbar: [xxx],
                ...
           })
   }
});

Checkout this Configuration - CKEditor 5 Documentation for toolbar reference, in my case I’m justing using toolbar: [“imageUpload”]

Best regards

3 个赞

Hey guys! Maybe I could use a little help from you!

I’m working in a project which I use more than one composer, like this (in the beginning of the initial page, for users create topics by there, just like a main composer facebook-like).

Screen Shot 2021-01-15 at 12.27.20

According to this, I have been getting some issues when opening composer (maybe 'cause I’m already using in main page).

So, when I want to update a topic, I use composer controller to open model, but getting b-editor message.

Have you guys getting same problem in working with multiple composers ?

Best Regards,
Felipe

3 个赞

maybe you can deactivate the plugin for now. As I said, this is still work in progress. I will probably work more on it next month. I focus on learning mandarin at the moment lol. If you want you can link me to your github or send me your code so I can try and understand what you are trying to do.

5 个赞

Reporting a bug, it seems after activating the plugin, the management section was covered.

  • Test version: Discourse 2.7.4 stable
  • Test browser: chrome, firefox on both computer and mobile phone

Selection_750
Selection_751

5 个赞

Hello, will it support 3-rd party additional plugins-functions for standard editor like… ?

It will support ckeditor addons instead.

This is an ui simplification experiment of mine that will probably be put into a separate plugin. Feature creep is bad haha

I want to say something: without a source of monetization it does not make sense for me to write this code. I also tried to do closed source plugins:

But the the issue is that code gets shared among buyers, which means there would be a need for a constant stream of new clients that dont come through word of mouth which is hardly sustainable.

So I would be interested if you would be willing to pay for this and if you have any suggestions on how we can solve the code sharing among buyers problem.
If yes please tell me how much in the comments below. :smiley:

Would you be willing to pay for this?
  • yes
  • no
0 voters

thaaanks

1 个赞

Does this your new WYSIWYG editor change the posts structure over standard Discourse? By another words if your editor will be disabled - does posts created with your editor will have any issues with editing by the standard editor?

Do you have a monetization plan how to raise a sum of money?

at the moment the editor generates markdown so we can use both editors next to each other without any issue. But the experience is not perfect and it always will be if we stick to markdown. Thats why the final solution will produce html. If this is a deal breaker for someone because they dont want to be locked in, there is an easy fix for this: just convert the html back to markdown.

I think there is no need to raise money up front. If I know there is a bunch of people that would be willing to pay for it and how much I will just finish the code. You can also reach out to me in private if you feel uncomfortable sharing budget related discussions in public.

4 个赞

Have you try to discuss this nuance with Discourse Team? Maybe they also want to add some new WYSIWYG editor?

they opted against it on philosophical grounds. You can search the forum if you are interested in the details. Their arguments are totally valid and I respect them. Thats why I am working on this.

7 个赞

“Just-in-time rendering of markdown” 的方法越来越受欢迎。Roam Research 和 Obsidian(最新更新增加了所见即所得功能)以及前面提到的 Typora 都采用了这种方法。您可以在 Typora 网站上看到一些实际示例:

这种“所见即所得”结合现有工具栏的方式对我来说是最好的。大多数人实际上并不需要超出 markdown 提供的格式。他们需要的是一种更直观的方式来生成和编辑 markdown。

8 个赞

说得好。我认为 tiptap.dev 是迄今为止最好的方法:它们有键盘快捷键,让您感觉像在编辑 markdown,但实际上是一个真正的所见即所得编辑器。我开始用 tiptap 重写插件,而不是用 ckeditor。但我没有发布它,因为我找不到资金(我不由 discourse 支付)。
我也不在乎花我的空闲时间来处理这个问题。
此致,
Spirobel

4 个赞

每次用户必须使用(并记住)快捷方式和命令时,所见即所得(WYSIWYG)就无关紧要了。大多数人既不使用也不理解 Markdown 或 HTML。那些知道的人很少需要所见即所得,而且大多数情况是在不完全确定输出格式的情况下,例如表格。

这里有相当多的人生活在一个非常狭小的圈子里。WordPress 之所以受欢迎,Ghost 之所以处于边缘地位,是有原因的。

只有我一个人这么想吗?我讨厌 Typora。所有那些跳来跳去的操作让我头疼。

是的,我知道 Discourse(几乎)永远不会有真正的所见即所得,即使大多数用户会喜欢它。

这绝对是可以实现的。我已经完成了大约 80%。问题是:我没有足够的兴趣去完成它。Discourse 更像是一个公司产品,而不是一个开源项目。这里的人们大多是公司员工,或者想将 Discourse 用于他们自己的项目。所以,能量就不在那里了。也许有一天我真的无聊了,我会完成它,只是为了证明这一点。:grinning:
祝您有美好的一天,
Spirobel :grinning_face_with_smiling_eyes:

8 个赞

社区成员在这些项目上付出巨大努力,社区也需要付出更大的努力来赞助这些项目。

然而,在 Meta 内部进行众筹是一个棘手的领域。Pavilion 正在探索更简便的方法。

8 个赞

这个网站是否仍然可以用于测试此插件?看起来它仍然在使用内置编辑器。

1 个赞