steve2955 / md2apkg Goto Github PK
View Code? Open in Web Editor NEW📝 A simple markdown to anki-deck converter without any weird custom syntax
Home Page: https://www.npmjs.com/package/md2apkg
License: GNU General Public License v3.0
📝 A simple markdown to anki-deck converter without any weird custom syntax
Home Page: https://www.npmjs.com/package/md2apkg
License: GNU General Public License v3.0
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.
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:
%
.BTW: The latex handling it's pretty awesome.
I've also been following, issue #15
Thanks again for the great work!
Let me start by saying that I love this plugin
Been using it for years!
But in the more recent versions of Anki:
This type of card is broken:
## What's the difference between `read` and `recv`?
Enter any text here
<!-- meta pkg split -->
- The argument `flags`
- `recv` with `flags = 0` is basically a `read`
![1](attachements/2024-05-24-16-31-03.png)
Without the non header text the front and back of the anki card good. With it the front and back get mixed, and the back is kind of broken.
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.
Es gibt einige Punkte, an denen wir vielleicht sinnvolle Fehlermeldungen ausgeben sollten oder noch ein paar Fehler auffangen könnten:
-f
wäre wahrscheinlich eine gute Idee)Soweit nur das, was mir spontan eingefallen ist. Da gibt's vielleicht noch ein paar Sachen mehr.
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.
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.
Dollar Metacharacter gets converted to /[
Example:
Three ways to switch to home folder:
cd
cd ~
cd \)HOME <------------
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
To test, use my attached file and use the md2apkg
package: npm init -y && npm i md2apkg && npx md2apkg -i test.md
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 😅
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.
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.
@RvNovae @ZeroPointMax Any Ideas on what to do about this?
Filename: 003\ certificate.md
Deckname: certifcate
tests should be run on each PR and commits to main
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.