Giter Site home page Giter Site logo

markdown-to-anki's Introduction

markdown-to-anki

A simple little tool to convert specifically formatted markdown to a format that can be imported by anki into flash cards.

Usage

# install
npm i -g markdown-to-anki

# print formatted cards to stdout
markdown-to-anki flashcards.md

# save cards as a file
markdown-to-anki flashcards.md > flashcards.txt
# then go open flashcards.txt with your anki app

When importing the cards, make sure the checkbox for "Allow HTML in fields" is checked.

Markdown Format

This tool expects your markdown to be specifically formatted, and deviations from this format could cause it to break in unexpected ways, or produce "bad" output.

Each card has a front and a back. The front and back are separated by a newline, three dashes, and another newline:


---

And each card is separated by newlines surrounding three equals signs:


===

The front or back of a card can have any markdown you wish. This tool uses marked to parse the markdown and generate html. Here's an example:


Here is a question for the first card:

---

And here is the answer

===

This is a question on the second card

---

and yet another answer

===

Here's a card

with multiple paragraphs

---

- and
- a
- bulleted
- list

markdown-to-anki's People

Contributors

zgulde 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

markdown-to-anki's Issues

Error when converting

Hello

I understand that there is no release yet.
I got this error

$ markdown-to-anki flashcards.md
/usr/lib/node_modules/markdown-to-anki/markdown-to-anki:56
)
^
SyntaxError: Unexpected token )
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
user8@user8-Latitude-E6410:~/Documents/markdown2anki$ gedit /usr/lib/node_modules/markdown-to-anki/markdown-to-anki

A suggestion: https://github.com/ewnd9/anki-apkg-export could be used to directly generate an apkg file.

Incorrect output of even your text example

Hi I am attempting to convert your .md to html in a .txt and it's incorrect

I get:

<p>Here is a question for the first card:</p> <hr> <p>And here is the answer</p> <p>===</p> <p>This is a question on the second card</p> <hr> <p>and yet another answer</p> <p>===</p> <p>Here&#39;s a card</p> <p>with multiple paragraphs</p> <hr> <ul> <li>and</li> <li>a</li> <li>bulleted</li> <li>list</li> </ul> undefined

AND it always says 'undefined' which is preceded by a tab.

Thanks,
I would really love to use this working!

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.