[Python] Pandoc filter to treat (Python) script output as Markdown

Discussão em 'Python' iniciado por Stack, Dezembro 17, 2024.

  1. Stack

    Stack Membro Participativo

    I need a Pandoc filter that takes Python as the code block, runs it, and then treats the output of the script as Markdown. Something like:

    # Heading

    ```{.pyscript}
    import datetime.datetime
    print(f"The current date and time are {str(datetime.now()}.")
    ```


    have the filter turn it into:

    # Heading

    The current date and time are 2024-12-17 14:11:28.684357


    which pandoc will then format appropriately. Does any such thing exist?

    Continue reading...

Compartilhe esta Página