from flask import render_template
import markdown, os

def callback(filename):
    output = markdown.markdown(open(os.path.join("templates", "pages", filename), "r").read())
    return render_template(
        f'bases/md.html',
        title = filename.split("/")[-1],
        markdown = output
    )