2019-05-12 22:48:15 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-07-06 16:50:38 -04:00
|
|
|
# name: discourse-math
|
|
|
|
# about: Official mathjax plugin for Discourse
|
|
|
|
# version: 0.9
|
|
|
|
# authors: Sam Saffron (sam)
|
2018-06-30 17:18:39 -04:00
|
|
|
# url: https://github.com/discourse/discourse-math
|
2022-03-05 11:21:55 -05:00
|
|
|
# transpile_js: true
|
2017-07-06 16:50:38 -04:00
|
|
|
|
2019-09-09 01:08:01 -04:00
|
|
|
register_asset "stylesheets/common/discourse-math.scss"
|
2023-01-18 06:35:27 -05:00
|
|
|
register_asset "stylesheets/ext/discourse-chat.scss"
|
2019-09-09 01:08:01 -04:00
|
|
|
|
2017-07-06 16:50:38 -04:00
|
|
|
enabled_site_setting :discourse_math_enabled
|
2023-01-18 06:35:27 -05:00
|
|
|
|
|
|
|
after_initialize do
|
2023-08-14 17:24:13 -04:00
|
|
|
if respond_to?(:chat) && SiteSetting.chat_enabled
|
|
|
|
chat&.enable_markdown_feature("discourse-math")
|
|
|
|
chat&.enable_markdown_feature("math")
|
|
|
|
chat&.enable_markdown_feature("asciimath") if SiteSetting.discourse_math_enable_asciimath
|
|
|
|
end
|
2023-01-18 06:35:27 -05:00
|
|
|
end
|