-
Notifications
You must be signed in to change notification settings - Fork 88
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 to src blocks #97
Comments
You don't need an external program since anki-editor exports the src code blocks as Then you to add a CSS to your anki card template like: |
I don't think it is even necessary to add any CSS to your anki cards. If |
@doolio Hi, why doesn't it work for me? I confirmed that the value of |
Hi @matiya,
Could you elaborate on this? I added the below code at the beginning of the file, but it didn't work:
I've tried with |
Odd it works for me. As for what matiya suggested he was referring to adding the CSS within Anki itself in your card template. I have the following in the "Styling" box of the card GUI from within the Browse GUI. You can change it to your tastes.
|
Thanks, it looks much better with your CSS. P.S. detailed steps to add custom CSS on Anki:
|
Glad to hear it. |
As @doolio was saying, the syntax highlighting from the org mode source block should automatically export to Anki without having to add any CSS in the card template. If this is not working, you may need to install the htmlize package. See: https://stackoverflow.com/questions/24082430/org-mode-no-syntax-highlighting-in-exported-html-page This fixed the issue in my case. |
@drdrjacobs You're right, it works perfectly after installing the htmlize package (with |
This would basically mean running code blocks through some extra formatting script to add syntax highlighting like this plugin does: https://github.com/glutanimate/syntax-highlighting
The text was updated successfully, but these errors were encountered: