Does anyone knows of a working Python GFM implementation?
Currently I'm using a javascript renderer. It works, but an actual Python renderer would be the right tool for the job. (FS is a Django app)
I tried combining this with this. But the results are not so good.
relevant code --> https://github.com/freedomsponsors/www.freedomsponsors.org/blob/master/djangoproject/core/models.py (see IssueComment.toHTML)
Syntax highlighting is a plus.
Markdown is an easy-to-read, easy-to-write syntax for formatting plain text. We've added some custom functionality to create GitHub Flavored Markdown, used to format prose and code across our site.
To add a Python code chunk to an R Markdown document, you can use the chunk header ```{python} , e.g., ```{python} print("Hello Python!") ```
You use the open() function to open the Picnic.md file; passing the value 'r' to the mode parameter to signify that Python should open it for reading. You save the file object in a variable called f , which you can use to reference the file. Then you read the file and save its contents inside the text variable.
GitHub uses Redcarpet which is really a Ruby binding built by github for Sundown.
There's a binding for Sundown in Python called Misaka. If you want to have something closer to the renderer github uses but in python you might start there.
For code highlighting you can use Pygments with Misaka.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With