2018-10-06 19:10:08 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-12-15 09:51:16 -05:00
|
|
|
module Banzai
|
2018-09-19 15:58:43 -04:00
|
|
|
# if you need to render markdown, then you probably need to post_process as well,
|
|
|
|
# such as removing references that the current user doesn't have
|
|
|
|
# permission to make
|
|
|
|
def self.render_and_post_process(text, context = {})
|
|
|
|
post_process(render(text, context), context)
|
|
|
|
end
|
|
|
|
|
2015-12-15 09:51:16 -05:00
|
|
|
def self.render(text, context = {})
|
|
|
|
Renderer.render(text, context)
|
|
|
|
end
|
|
|
|
|
2017-11-06 11:52:56 -05:00
|
|
|
def self.render_field(object, field, context = {})
|
|
|
|
Renderer.render_field(object, field, context)
|
2016-10-06 17:17:11 -04:00
|
|
|
end
|
|
|
|
|
2016-07-05 11:21:13 -04:00
|
|
|
def self.cache_collection_render(texts_and_contexts)
|
|
|
|
Renderer.cache_collection_render(texts_and_contexts)
|
|
|
|
end
|
|
|
|
|
2015-12-15 09:51:16 -05:00
|
|
|
def self.render_result(text, context = {})
|
|
|
|
Renderer.render_result(text, context)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.post_process(html, context)
|
|
|
|
Renderer.post_process(html, context)
|
|
|
|
end
|
|
|
|
end
|