Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add syntax highlighting support for code blocks #29

Open
leouieda opened this issue Apr 12, 2022 · 0 comments
Open

Add syntax highlighting support for code blocks #29

leouieda opened this issue Apr 12, 2022 · 0 comments

Comments

@leouieda
Copy link
Owner

leouieda commented Apr 12, 2022

With the change to markdown-it-py (#28), we can now add a custom rendering rule for code blocks (the ones with tripple-backticks) that replaces the code block with the rendered version from Pygments (see https://pygments.org/docs/quickstart/). This should be done in markdown_to_html in nene/rendering.py.

Note that this would only add the proper tags and classes without any inline styles. The actual style definitions would come from CSS stylesheets that the user must include in their templates. See https://pygments.org/styles/ for available styles which can be exported to CSS using the command line https://pygments.org/docs/cmdline/#generating-styles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant