@lru_cache((512 if settings.PRODUCTION else 0))
@register.filter(name='render_markdown_path', is_safe=True)
def render_markdown_path(markdown_file_path):
 global md_extensions
 if (md_extensions is None):
  md_extensions = [markdown.extensions.toc.makeExtension(), markdown.extensions.admonition.makeExtension(), markdown.extensions.codehilite.makeExtension(linenums=False, guess_lang=False), zerver.lib.bugdown.fenced_code.makeExtension(), markdown_include.include.makeExtension(base_path='templates/zerver/help/include/')]
 md_engine = markdown.Markdown(extensions=md_extensions)
 md_engine.reset()
 markdown_string = force_text(open(markdown_file_path).read())
 html = md_engine.convert(markdown_string)
 return mark_safe(html)

@ lru_cache ( ( 512 if settings . PRODUCTION else 0 ) ) @ register . filter ( name = 'render_markdown_path' , is_safe = True ) def render_markdown_path ( markdown_file_path ) : global md_extensions if ( md_extensions is None ) : md_extensions = [ markdown . extensions . toc . makeExtension ( ) , markdown . extensions . admonition . makeExtension ( ) , markdown . extensions . codehilite . makeExtension ( linenums = False , guess_lang = False ) , zerver . lib . bugdown . fenced_code . makeExtension ( ) , markdown_include . include . makeExtension ( base_path = 'templates/zerver/help/include/' ) ] md_engine = markdown . Markdown ( extensions = md_extensions ) md_engine . reset ( ) markdown_string = force_text ( open ( markdown_file_path ) . read ( ) ) html = md_engine . convert ( markdown_string ) return mark_safe ( html )
given a path to a markdown file .