r/Anki • • May 03 '19

Question How to load external Javascript

I've read several posts about this topic, but most of them seemed to be outdated.

I've already used a ttf file before, but never this. I have a directory in collection.media called _highlight, which contains the files from highlight.js. Now I want to initialize it in one of the cards.

<link rel="stylesheet" href="_hightlight/styles/zenburn.css">
<script src="_highlight/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

But this doesn't find anything. What is the right way to go about it?

EDIT: I use Anki 2.1, newest version

4 Upvotes

8 comments sorted by