phisch
(Philipp)
2016 年8 月 14 日 11:46
1
Hi,
How modular is Discourse internally? Will it easily be possible to develop a plugin which uses a different approach to discussion for a certain category?
Does Discourse use the MVVM principle or something similar, so that a discussion tree (or network) can be displayed in a different manner than it is now?
Basic example: Show Discussion as a tree rather than a list (this is not what I want to do)
If not, is it planned to achieve more modularity?
erlend_sh
(Erlend Sogge Heggen)
2016 年8 月 14 日 12:17
2
这些问题非常宽泛。你可以通过浏览我们的 Customization > Plugin 目录,看看大家是如何使用它的,从而找到关于“模块化程度”的答案。然后,可以参考以下新手指南:
在 Discourse 中构建插件其实非常简单,只要你了解一些 quirks(怪癖/特性)。本帖的目标是创建一个骨架插件,并向你介绍基础知识。
你的开发环境
请确保你的电脑上正在运行 Discourse 的开发环境。建议你使用 相应的安装指南 ,完成后请回到这里。
plugin.rb
使用 GitHub - discourse/discourse-plugin-skeleton: Template for Discourse plugins · GitHub 在你的 plugins 目录中创建一个完整的 Discourse 插件骨架
骨架现在已捆绑在 Discourse 核心中,运行 rake plugin:create[plugin-name] 将使用骨架创建一个插件
当 Discourse 启动时,它会在 plugins 目录中查找包含 plugin.rb 文件的子目录。plugin.rb 文件有两个用途:它是你插件的清单,包含关于你插件的必要信息,包括:名称、联系信息和描述。第二个用途是初始化运行插件所需的任何 Ruby 代码。
在我们…
There are a few ‘how to start’ guides for working with Discourse already and a wealth of useful info on meta, but I thought it might help to give an insight to the mental processes of starting from little, if any, prior coding experience to building substantial Discourse plugins.
Discourse is written by experienced developers and has a large codebase. This can feel intimidating. This intimidation factor can be a significant barrier for novice developers. This is a kind of ‘psychological primer’…
Falco
(Falco)
2016 年8 月 15 日 13:35
3
Read the Source, Luke
https://github.com/discourse/discourse
PS: Discourse is an Ember app powered by a Rest API, so yes.