Giter VIP home page Giter VIP logo

md2apkg's People

Contributors

rvnovae avatar steve2955 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

md2apkg's Issues

Exceed Max Memory with too much cards

I was using a Deck with a little bit more of content and a higher number of cards.
By trying to compile, I would get a Memory issue:

➜ md2apkg -i test.md
found 71 cards!
writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!
deck initialized!
Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 16777216, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0
Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 16777216, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile w
ith  -s ABORTING_MALLOC=0

Test

To test, use my attached file and use the md2apkg package: npm init -y && npm i md2apkg && npx md2apkg -i test.md

test.md

Workaround/Fix

The issue comes from the anki-pkg-export package.

I saw, that there was a comment with a way to probably fix this: repeat-space/anki-apkg-export#25 (comment) and that you're currently also maintaining the anki-apkg-export fork for this package. Would it be possible to implement the proposed change in md2apkg ?

Currently I'm using this as a workaround. Nevertheless, that's clearly not the solution as people using this package don't know about this upstream Issue 😅

Features Request

I would like to start by expressing how excited I am about md2anki. I've followed mdanki for a long time. However, the issue with exports overriding cards, it's truly a deal breaker. Cards, get added and modified all the time. It's truly exciting that you guys were able to fix this issue!

Couple of useful features I would like to request from mdanki are:

  1. Ability to extend card front with %.
  2. Code highlighting

BTW: The latex handling it's pretty awesome.
I've also been following, issue #15

Thanks again for the great work!

implement support for latex

I already tried adding support for LaTeX using markdown-it-texmath and katex. However, that didn't work out first try. Also it would bloat our decks quite a bit when including alot of custom css and custom fonts.

So for implementing this, we should probably stick to the official way. But I will have to look into this again.

Add support for config file

Dollar Metacharacter gets converted to /[

Example:

Three ways to switch to home folder:
cd
cd ~
cd \)HOME   <------------

Bug: Use package locally

Hey 👋 , I was searching for a package to replace md2anki as it overrides cards when updating the deck. Your package seems to be a good replacement., thanks for that.

Nevertheless, it seems that using the Package by installing it locally does not work. You can see my example attached. If I install the package(npm i md2apkg) and then run it by doing npx md2apkg capitals.md(Or use it with npm run ...) it seems to stop somewhere in this function: https://github.com/Steve2955/md2apkg/blob/main/src/index.js#L131

➜ npx md2apkg capitals.md
found 50 cards!

It would be helpful, if it could be avoided to having to install it globally.

anki-test.zip

Anki crashes on import

Import NET-Barie -> Crash
new start: after import
image
empty..
cards do exist tho
image
renaming manually fixes this
image
image

npm release

Wenn das Teil hier halbwegs funktionstüchtig ist, würde ich es auch in die Package-Registries packen. Leider ist md2anki und mdanki schon vergeben. Hat jemand zufällig ne ultra kreative Idee oder läuft es auf sowas wie @Steve2955/md2anki hinaus? Den Befehl sollte man dann bei einer globalen Installation (vermutlich) trotzdem als md2anki verwenden können. Aber das muss ich mir nochmal anschauen.

unify card fronts

The way the fronts of cards are currently parsed make all of the different heading levels look different within Anki.

All fronts should be displayed the same independently from the actual heading level. But, basic formatting (bold, italic, inline code, ...) should be preserved.

Optionally it should be possible to display the hierarchy of a card below its title.

implement support for ignoring certain heading levels

A parameter should be added to filter out certain heading levels.

md2anki --ignore-levels 1,2,5,6 README.md

The above code should generate a deck containing only cards with H2 or H3. Adequate tests for those cases should be added as well.

implement support for images

Adding support for images should be quite easy. When adding cards to the deck in deckFromCards(), the tokens should be checked for images and added using the following method:

apkg.addMedia('anki.png', fs.readFileSync('anki.png'));

Maybe add a parameter to define a custom base path to image resources.

improve stability, better error-handling

Es gibt einige Punkte, an denen wir vielleicht sinnvolle Fehlermeldungen ausgeben sollten oder noch ein paar Fehler auffangen könnten:

  • I/O-Fehler mit files
    • Output wird standardmäßig überschrieben (-f wäre wahrscheinlich eine gute Idee)
  • Bilder existieren nicht (als file)
  • Fehler beim Markdown-Parsen/Rendern
  • keine Karten gefunden bzw. alle ignoriert

Soweit nur das, was mir spontan eingefallen ist. Da gibt's vielleicht noch ein paar Sachen mehr.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.