Example #1
0
def on_card_did_render(
    output: TemplateRenderOutput, ctx: TemplateRenderContext
) -> None:
    output.question_text = render_latex(
        output.question_text, ctx.note_type(), ctx.col()
    )
    output.answer_text = render_latex(output.answer_text, ctx.note_type(), ctx.col())
def insert_fen_table(output: TemplateRenderOutput,
                     context: TemplateRenderContext):
    u"""
    Replace well formed  FEN data with a chess board diagram.

    This is a wrapper that looks for `[fen]`, `[/fen]` tags and
    replaces the content.
    """
    # replace both answer and question tag
    output.question_text = fen_re.sub(insert_table, output.question_text)
    output.answer_text = fen_re.sub(insert_table, output.answer_text)