mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 18:22:40 +08:00
DEV: introduces documentation for chat (#19772)
Note this commit also slightly changes internal API: channel instead of getChannel and updateCurrentUserChannelNotificationsSettings instead of updateCurrentUserChatChannelNotificationsSettings. Also destroyChannel takes a second param which is the name confirmation instead of an optional object containing this confirmation. This is to enforce the fact that it's required. In the future a top level jsdoc config file could be used instead of the hack tempfile, but while it's only an experiment for chat, it's probably good enough.
This commit is contained in:
13
plugins/chat/lib/tasks/chat_doc.rake
Normal file
13
plugins/chat/lib/tasks/chat_doc.rake
Normal file
@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
task "chat:doc" do
|
||||
destination = File.join(Rails.root, "plugins/chat/docs/FRONTEND.md")
|
||||
config = File.join(Rails.root, ".jsdoc")
|
||||
|
||||
files = %w[
|
||||
plugins/chat/assets/javascripts/discourse/lib/collection.js
|
||||
plugins/chat/assets/javascripts/discourse/services/chat-api.js
|
||||
]
|
||||
|
||||
`yarn --silent jsdoc2md --separators -c #{config} -f #{files.join(" ")} > #{destination}`
|
||||
end
|
Reference in New Issue
Block a user