wilddom / memrise2anki-extension

An extension for Anki 2 that downloads and converts a course from Memrise into an Anki deck.
ISC License
159 stars 22 forks source link

Will this extension import my mems from memrise? #22

Closed olliebaum closed 9 years ago

olliebaum commented 9 years ago

This extension says it can import a course from memrise, but does it currently allow you to import your mems from memrise? (Mems are the notes you create to help you learn and remember the information.)

wilddom commented 9 years ago

No, the add-on does not import mems at the moment. I'll look into it, no promises though.

olliebaum commented 9 years ago

Thanks, it would be really cool if you did. Then any chosen mems could be added to the back of a card to help you remember it better for next time.

wilddom commented 9 years ago

I have implemented support for mems now. But it's not heavily tested...

olliebaum commented 9 years ago

That's really great! Thanks for all your hard work. I'll test it out later and hopefully I can let you know if anything is not working. Just so I know, how have you implemented it? What should I expect to see? I'm expecting it to only import the mems I've selected.

wilddom commented 9 years ago

Well, there is now a checkbox which controls the mem import. I suppose you have already imported the course without mems. In that case you can update your existing deck, just open the import screen again and select the existing deck. But before doing that you would have to edit the existing note type manually and add a field for the mems. Later on in the import procedure you will be asked to assign this field. And of course afterwards you would have to edit the template too. It's recommended to take a backup of your collection before doing this.

olliebaum commented 9 years ago

If I update my existing deck will it overwrite my anki progress?

wilddom commented 9 years ago

Just make sure the "Import scheduler information" checkbox is deactivated.

olliebaum commented 9 years ago

There are two new field types - “Mem: artist" and “Mem: none”. Do I need to add field for them both?

olliebaum commented 9 years ago

I’m getting this error when I try and update a deck:

Traceback (most recent call last):

File "/Users/ollie/Documents/Anki/addons/Memrise_Course_Importer/importer.py", line 777, in importCourse

values.extend(self.toList(self.getWithSpec(thing, spec)))

File "/Users/ollie/Documents/Anki/addons/Memrise_Course_Importer/importer.py", line 720, in getWithSpec

if values.isTextMem():

AttributeError: 'NoneType' object has no attribute 'isTextMem'

wilddom commented 9 years ago

Could you tell me the course url?

olliebaum commented 9 years ago

Sure. It’s http://www.memrise.com/course/54535/who-composed-me/

wilddom commented 9 years ago

Well... I found some things:

  1. The bug you mentioned is fixed.
  2. There is a strange bug in the data from memrise. Actually a mem should only be valid for one testing direction (Front->Back), but in this course I get an invalid testing direction (column 0->column 0). So I had to implement a workaround which will unfortunately not work perfectly.
  3. I didn't know mems can mix text and images. So there is still some work to do for complex mems. Simple text and images should work.
olliebaum commented 9 years ago

Okay, thanks. I’ll give it another try and see what happens.

wilddom commented 9 years ago

I'll need to implement some kind of Markdown syntax: http://memrise-users.wikia.com/wiki/Mems_Formatting_Feature Additionally there is an undocumented syntax for images: "img:[url]"

olliebaum commented 9 years ago

Thanks. It seems to be be working pretty well for me now.

But this is still really amazing! Nice job.

wilddom commented 9 years ago

Thank you for the feedback.

olliebaum commented 9 years ago

Well currently it shows "embed:[my youtube url]". If it just showed a link instead that would be great. If it helps - I think memrise uses embed.ly to embed any content linked using the "embed:" syntax. The embed.ly api fetches the html embed code and adds it in-line. But yeah as I said, just a link would be fine.

olliebaum commented 9 years ago

Apparently you can use oembed http://www.oembed.com to return an embed code for a URL. It has a python library too. But the problem is I tried putting some embed code in a field but Anki just shows the code and not the video. (If you paste the embed code directly into the card’s HTML, it works.)

wilddom commented 9 years ago

Okay, but as Anki officially does not support such embed codes (iframes, etc.) it seems a bit "hackish".

wilddom commented 9 years ago

I just noticed that I misinterpreted memrise's data, so it's possible that wrong mems were imported. But that's fixed now and so is bold formatting. Next step is full Markdown support.

wilddom commented 9 years ago

Now we have full Markdown support for mems. Embedded media using embed:[url] will be converted to a link.

wilddom commented 9 years ago

And now there is an option to embed online media (disabled by default).

olliebaum commented 9 years ago

This is great! The embedding online media is working great for me. I noticed one small problem - if there's a space between "embed:" and the URL then the embed doesn't work and it just generates a link.

wilddom commented 9 years ago

Okay, should be more tolerant to spaces now.