sbseltzer / ja-srs-utils

Formatting better Japanese SRS cards
MIT License
0 stars 0 forks source link

Add initial Mnemosyne support #5

Closed sbseltzer closed 7 years ago

sbseltzer commented 7 years ago

After some initial testing, it looks like Mnemosyne is a definite go.

Media directory on Windows: %APPDATA%/Mnemosyne/default.db_media

sbseltzer commented 7 years ago

I submitted an install script, which "works", but something in the javascript appears to be breaking in Mnemosyne. The include.js script doesn't work, but separately adding each dependency does appear to work. Not only that, but the HTML parser seems to ignore HTML comments. Very strange.

This seems to be a completely legit use-case for doing a compression/combination as suggested in #3.

sbseltzer commented 7 years ago

Combining seems to fix the issue (mostly) but I cannot seem to include link elements via script successfully. Furthermore, prepending db_media:/// to paths doesn't work on script elements but DOES work on link elements. Not sure how to mitigate that yet.

It seems like references only get resolved once when the card first loads, but then again, I managed to include a trivial script in the same way I do via include.js.

In fact, it seems that the problem is that I cannot include from an include. That is:

<script>
// include A, B, and C
</script>

The above will work. Putting the contents of the above (i.e. including A, B, and C) in somescript.js and doing <script src="somescript.js"></script> will NOT work. That extra leap of including from an include is just too much for Mnemosyne right now. Either the user will need to be given a few lines to copy-paste, or some combined script will be needed.

NOTE: somescript.js can document.write style tags and it will work as expected, but the same is not true for link tags. Presumably because a reference must be resolved.

sbseltzer commented 7 years ago

I got a basic combiner committed, but font cycling doesn't seem to work right.

sbseltzer commented 7 years ago

Font cycling DOES work, but CSS fonts do not seem to work. Making a new issue for it.