All Projects → benwr → Ankdown

benwr / Ankdown

Licence: mit
Easily make Anki flash cards in markdown

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Ankdown

Vnote
A pleasant note-taking platform.
Stars: ✭ 8,714 (+7750.45%)
Mutual labels:  markdown, mathjax
Jekyll Spaceship
🚀 A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, mermaid, emoji, video, audio, youtube, vimeo, dailymotion, soundcloud, spotify, etc.
Stars: ✭ 196 (+76.58%)
Mutual labels:  markdown, mathjax
Texme
Self-rendering Markdown + LaTeX documents
Stars: ✭ 1,970 (+1674.77%)
Mutual labels:  markdown, mathjax
Codebe
CodeBe(码币)是一个是使用angular2整合各种插件的项目,包括(layer,bootstrap-table,markdown编辑器,highcharts,ckeditor,高德地图,fullcalendar 等等)。如果你有什么想要集成的插件,请告诉我,我来加进去。(请给我加个星,谢谢。)
Stars: ✭ 307 (+176.58%)
Mutual labels:  markdown, mathjax
Markdown Preview.vim
⚠️ PLEASE USE https://github.com/iamcco/markdown-preview.nvim INSTEAD
Stars: ✭ 764 (+588.29%)
Mutual labels:  markdown, mathjax
Liandi
📕 一款桌面端的 Markdown 块级引用和双向链接笔记应用,支持 Windows、Mac 和 Linux。A desktop Markdown Block-Reference and Bidirectional-Link note-taking application, supports Windows, Mac and Linux.
Stars: ✭ 354 (+218.92%)
Mutual labels:  markdown, mathjax
Markdown Preview Enhanced
One of the 'BEST' markdown preview extensions for Atom editor!
Stars: ✭ 3,478 (+3033.33%)
Mutual labels:  markdown, mathjax
Cocalc
CoCalc: Collaborative Calculation in the Cloud
Stars: ✭ 888 (+700%)
Mutual labels:  markdown, mathjax
Markdeck
presentations as code - author cool slide decks, text-only, offline-ready, collaborative
Stars: ✭ 1,159 (+944.14%)
Mutual labels:  markdown, mathjax
Vue Cli Multipage Bootstrap
vue-cli-multipage-bootstrap demo with vue2+vue-router+vuex+bootstrap+markdown for learning vue2.0
Stars: ✭ 105 (-5.41%)
Mutual labels:  markdown
Prettier
Prettier is an opinionated code formatter.
Stars: ✭ 41,411 (+37207.21%)
Mutual labels:  markdown
Markdown Extension
[DEPRECATED] Markdown support for Twig
Stars: ✭ 105 (-5.41%)
Mutual labels:  markdown
Mikidown
A note taking application, featuring markdown syntax.
Stars: ✭ 105 (-5.41%)
Mutual labels:  markdown
Jekyll
🌐 Jekyll is a blog-aware static site generator in Ruby
Stars: ✭ 43,803 (+39362.16%)
Mutual labels:  markdown
Oscp Exam Report Template Markdown
📙 Markdown Templates for Offensive Security OSCP, OSWE, OSCE, OSEE, OSWP exam report
Stars: ✭ 2,066 (+1761.26%)
Mutual labels:  markdown
Pandiff
Prose diffs for any document format supported by Pandoc
Stars: ✭ 110 (-0.9%)
Mutual labels:  markdown
Md Roam
Use Org-roam with markdown files by adding Md-roam as a plug-in. Mix and match org and markdown files.
Stars: ✭ 104 (-6.31%)
Mutual labels:  markdown
Retext
ReText: Simple but powerful editor for Markdown and reStructuredText
Stars: ✭ 1,500 (+1251.35%)
Mutual labels:  markdown
Keyboard
⌨ Toward a more useful keyboard
Stars: ✭ 1,522 (+1271.17%)
Mutual labels:  markdown
Markdown Viewer
Markdown (.md) file viewer WebExtension for your browser.
Stars: ✭ 109 (-1.8%)
Mutual labels:  markdown

Ankdown

A simple way to write Anki decks in Markdown.

What This Is

Anki is awesome, in many ways. However, its card editor is... a little bit uncomfortable. I really wanted to write Anki cards in Markdown. So I made a tool to convert Markdown (+ standard MathJAX math notation) into Anki decks that can be easily imported. This way, it's possible to use any fancy markdown (and MathJAX) tools to build your decks.

How to use it

NOTE This program requires Python 3, along with the packages in requirements.txt

Installing

Ankdown can be installed by doing pip3 install --user ankdown.

Writing Cards

Cards are written in the following format:

Expected Value of \(f(x)\)

%

\[\mathbb{E}[f(x)] = \sum_x p(x)f(x)\]

%

math, probability

---

Variance of \(f(x)\)

%

\[\text{Var}(f(x)) = \mathbb{E}[(f(x) - \mathbb{E}[f(x)])^2]\]

Each of the solitary % signs is a field separator: the first field is the front of the card, the second field is the back of the card, and subsequent fields can contain whatever you want them to (all fields after the second are optional).

--- markers represent a card boundary.

The tool needs these separators to be alone on their own lines, and most markdown editors will work better if you separate them from other text with empty lines, so that they're treated as their own paragraphs by the editor.

Running Ankdown

Method A: manually

To compile your cards, put them in markdown files with .md extensions, inside of a directory that has the name of the deck you'd like to put the cards into. Then, run ankdown -r [directory] -p [package filename]. The package filename should end in .apkg.

You can then import the package using the Anki import tool. To do this, go to File > Import, and then in the drop-down menu select "Packaged Anki Deck/Collection (*.apkg)".

Method B: via the add-on

Once you've installed ankdown, it can be a hassle to run it on all of your decks over and over again. There is an ankdown Anki add-on that you can use to make this process simpler: If you put all of your decks in one megadirectory (mine is in ~/Flashcards), you can re-import your decks in one swell foop by going to Tools > Reload Markdown Decks (or using the operating-system-dependent keybinding).

Gotchas

Ankdown has an unusually large number of known issues; my preferred method of discussing them is via github ticket.

Multiple Decks

Ankdown uses Genanki as a backend, which doesn't (as of this writing) handle multiple decks in a single package very well. If you point ankdown at a directory with multiple decks in subdirectories, it will do its best, and your cards will all be added to the package, but they won't be assigned to the correct decks. The ankdown plugin solves this problem by running the executable on each deck individually, and then importing all the resulting packages.

Intentional feature removals

There used to be other ways to run ankdown, but they were slowly making the code worse and worse as I tried to keep them all operational. If there's a particular method of operating ankdown that you used and miss, let me know in a github issue.

Math separators

Unfortunately, $ and $$ as math separators were not chosen by the anki developers for the desktop client's MathJax display, and so in order for math to work in both web and desktop, it became much simpler to use \(\) and \[\]. These separators should be configurable in most markdown editors (e.g. I use the VSCode Markdown+Math plugin). Older decks that were built for ankdown need to be modified to use the new separators.

Media references

Ankdown should work with media references that result in src="" appearing somewhere in the generated html (mainly images). If you need it to work with other media types (like sounds), let me know in a github issue and I may make time to fix this.

Updating Cards

When you want to modify a card, just run your deck through the above process after changing the markdown file. Anki should notice, and update the card. This is done by giving the cards in your deck unique IDs based on their filename and index in the file.

This is the most robust solution I could come up with, but it has some downsides:

  1. It's not possible to automatically remove cards from your anki decks, since the anki package importer never deletes cards.
  2. If you delete a card from a markdown file, ankdown will give all of its successors off-by-one ID numbers, and so if they were different in important ways (like how much you needed to study them), anki will get confused. The best way to deal with this is to give each card its own markdown file.

General code quality

Lastly, the catch-all disclaimer: this is, as they say, alpha-quality software. I wrote this program (and the add-on) to work for me; it's pretty likely that you'll hit bugs in proportion to how different your desires are from mine. That said, I want it to be useful for other people as well; please submit github tickets if you do run into problems!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].