discourse-math/plugin.rb

22 lines
665 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-07-06 16:50:38 -04:00
# name: discourse-math
# about: Uses MathJax 203 or KaTeX 97 to render math expressions.
# meta_topic_id: 65770
2017-07-06 16:50:38 -04:00
# version: 0.9
# authors: Sam Saffron (sam)
2018-06-30 17:18:39 -04:00
# url: https://github.com/discourse/discourse-math
2017-07-06 16:50:38 -04:00
register_asset "stylesheets/common/discourse-math.scss"
register_asset "stylesheets/ext/discourse-chat.scss"
2017-07-06 16:50:38 -04:00
enabled_site_setting :discourse_math_enabled
after_initialize do
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
end