GithubHelp home page GithubHelp logo

mdanki's People

Contributors

amorriscode avatar ashlinchak avatar dependabot[bot] avatar larrybattle avatar rvbcldud avatar

Stargazers

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

Watchers

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

mdanki's Issues

Duplicates

This isn't necessarily an issue with mdanki, I am just curious how you manage duplicates.

For example, I add cards to my repo frequently. Once I am done adding some cards, I run mdanki. After this is done, if I just import the file directly I get duplicates in Anki. If I delete the deck and then add the new one, I lose all progress.

What does your workflow look like?

Issue with % separator when using [latex] math

I was testing if [latex] blocks would be supported, and indeed they work, except I needed to write \\[ to get \[ in the source, but still it works! e.g.

## [latex]\\[\sin^2\theta + \cos^2\theta = \\][/latex]

[latex]\\[\sin^2\theta + \cos^2\theta = 1\\][/latex]

produces

Screen Shot 2020-02-21 at 10 47 25 PM

(Need to have LaTeX installed)


Now onto the issue, since I tried to follow the README and produce a multi-line front of card:

## A

[latex]\\[e^x -1 = 3\\][/latex]

%

a text [latex]$e^x -1 = 3$[/latex]

Expected: front of card with A and one equation, back of card another equation

Actual:
Screen Shot 2020-02-21 at 10 50 16 PM

It seems the % separator doesn't get recognized correctly when the card contains [latex].

Joplin Port

Hey great Project!

I wrote a little script that allows me to use your project on Joplin!

https://github.com/quantumfate/utilityscripts/tree/main/Mdtoanki

It is a script for personal use so you would have to change variables according to your system yourself. The advantage is that you can call the script without having to provide long paths with every call.

There are some requirements and workarounds that I have explained in the Readme.md. The script replaces Joplin's internal Image linking with the paths to actual images so they can appear in the anki flash cards

How about support $$

I think the common way in markdown for edit mathematical formulas is using "$", in my editor this the only way to display the mathematical formulas.
Like:
[latex]\[e^x -1 = 3\][/latex] (does't work)
$e^x -1 = 3$ (work)
But the thing is anki and mdanki can't identify the second way.
I used to use another Tex editor and screenshot then paste to md editor.
But sometimes it's really time-consuming.
So how about support '$' input type.

Dont' know if this is importent for you.

Hi ashlinchak,
Output works! You can close the issue if you like.

mdanki /folderxxx/history.md /folderxxx/output/123.apkg
writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!
The deck "007 history" has been generated in /Users/lisa/Desktop/output/123.apkg

Deprecated version of Axios

When trying to install with npm install -g mdanki:

npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410

Changing the format of the Anki card?

When you convert a markdown file, the front of the card has something like this (when looking at the raw html):

<h2 id="front"><span style="font-weight: normal;">Front</span></h2>

Which results in the text of front of a card being bigger than I would like it (because it is a h2).

I would like to be able to have the raw html of the front of the card just be plain text. I do not like how it is left-align, the text being bigger and bold can be dealt with at a later time. Plus, I am not very familiar with JavaScript. I would, however, be willing to learn more and produce a solution.

So, if anyone could point me in the direction where the contents of the html of the front of the card (or the back for that matter) are defined, that would suffice. Thank you!

the highlight is unreadable

This is my awk command in Anki, and I found some words are shown in white color. I think there should be a black background.
image
below is my markdown to anki command.

 mdanki awk.md awk.apkg

Getting a "writeStringToMemory is deprecated" message when building anki files

Getting an warning message when building anki files on mdanki 1.0.2.
The built anki files work by the way.

Steps to reproduce

example.md

## Test

test

Command:

npx mdanki example.md example.apkg

Actual Output:

writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!
The deck "mdanki" has been generated in /home/u/markdown_to_anki/example.apkg

Expected Output:

The deck "mdanki" has been generated in /home/u/markdown_to_anki/example.apkg

Cause?

Wild guess but maybe the message comes from an old copy of sql.js that anki-apkg-export 4.0.3 is using.
Related links:

Support for cloze deletion

Hello, thanks for making this project! :-)

In my usage of Anki, I found that I tend to make as many cards as possible with cloze deletion, as opposed to the standard front/rear cards. At least myself, I find them more powerful.

Quoting the Anki documentation:

Cloze deletion is the process of hiding one or more words in a sentence. For example, if you have the sentence:

Canberra was founded in 1913.

…and you create a cloze deletion on “1913”, then the sentence would become:

Canberra was founded in [...].

(there is more to it, and the link above gives the full details)

Would you consider adding support for them in mdanki ? Thanks.

Ignoring level 1 headings

I would like to only generate cards with content inside level 2 headings.

For example this:

## heading 2
text inside
# heading 1
text inside

Would currently translate to a card like this:

[front]:
heading 2

[back]:
text inside
# heading 1
text inside

I would expect the card to not have level 1 heading and it's contents inside:

[front]:
heading 2

[back]:
text inside

So basically I would expect mdanki to ignore level 1 headings that are in the middle of the documents. Would this be possible? Or maybe there already is some way to have text in a markdown document that doesn't get included in the card?

Images in markdown - Path with spaces

When the filename of an image contains spaces, mdanki doesn't recognize the file.
A solution would be to use "%20" in the link and decodeUriComponent in MediaParser

data = fs.readFileSync(decodeURIComponent(filePath));

Cannot deal with large data batchly

Hi, thank you for this cool tool.

I have tried to convert a markdown file whose size is 302 KB.
And I also tried to split the large file into several files with lower 7KB, and it still failed.
It's ok to handle a small markdown file. So I guess it needs a lot of memory to fill before construct a .apkg file?

Here is error msg:

mdanki ./md/ dst.apkg
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 adjusts the size at runtime but prevents
some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or 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 adjusts the size at runtime but prevents
some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0
mdanki <source> <target>

Convert Markdown file into anki's apkg file for importing.

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]
  --config   Configuration file location                                [string]
  --deck     Deck name                                                  [string]

abort("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 adjusts the size at runtime but pr
events some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ") at Error
    at Ra (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:32:124)
    at Qa (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:32:22)
    at p (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:488:103)
    at Function.ba [as Gb] (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:12:164)
    at Ia (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:397:297)
    at _Q (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:465:135615)
    at Iu (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:468:26931)
    at sO (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:465:55965)
    at _f (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:459:91456)
    at Gu (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:468:26226)
    at Fu (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:468:24948)
    at Cu (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:468:23165)
    at Bu (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:468:21949)
    at qu (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:468:16949)
    at cs (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:462:94725)
    at sg (/usr/local/lib/node_modules/mdanki/node_modules/sql.js/js/sql.js:459:113005)
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.

[feature request] Add comment syntax

I am used to automatically generating a piece of json information in the md file, using --- as a separator, in order to use mdanki, I have to write a modification program to remove this json information, can I directly add this function in mdanki?

Support file-per-flashcard parsing strategy

Really nice work on this project! Been enjoying using it so far.

As a casual obsidian user, I have some projects where my markdown files are atomic (the name of the file is the key word, and the file content is the definition) instead of a long file with a lot of keywords and definitions. This would map nicely with ANKI and this tool if we could pass in another strategy as a CLI paramater or something that would handle this case.

I've started to hack this together locally and have it partially working, although it is nowhere near as clean as the rest of the project.

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.