内容简介:Converts Markdown file(s) to the Anki cards.Convert a single markdown file:
MDAnki
Converts Markdown file(s) to the Anki cards.
Install
npm install -g mdanki
Usage
Convert a single markdown file:
mdanki library.md anki.apkg
Convert files from directory recursively:
mdanki ./documents/library ./documents/anki.apkg
Using all available options:
mdanki library.md anki.apkg --deck Library --config config.json
Import just generated .apkg file to Anki ("File" - "Import").
Overriding default settings
To override default settings use --config option:
mdanki library.md anki.apkg --config faworite-settings.json
Supported files
MDAnki supports .md and .markdown files.
Cards
By default, MDAnki splits cards by ## headline. For example, below markdown will generate 2 cards where headlines will be on the front side and its description - on the back.
## What's the Markdown? Markdown is a lightweight markup language with plain-text-formatting syntax. Its design allows it to be converted to many output formats, but the original tool by the same name only supports HTML. ## Who created Markdown? John Gruber created the Markdown language in 2004 in collaboration with Aaron Swartz on the syntax.
If you want to have multiple lines on the card's front side - use % symbol for splitting front and back sides:
## YAGNI Describe this acronym and why it's so important. % "You aren't gonna need it" (YAGNI) is a principle of extreme programming (XP) that states a programmer should not add functionality until deemed necessary.
When parsing only one markdown file, the title of the deck could be generated based on the top-level headline ( # ).
Tags
Cards can have tags in their markdown sources. For adding tags to cart it should follow some rules:
#
MDAnki uses '^\\[#(.*)\\]' pattern for searching tags. This pattern could be overwritten by specifying custom settings. The source file in the tag link is optional.
The below example will generate a card with 3 tags: algorithms , OOP , and binary_tree .
## Binary tree In computer science, a binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child. [#algorithms](./algorityms.md) [#OOP]() [#binary tree]()
Code and syntax highlighting
Code blocks can be written with and without specifying a language name:
``java
public static void main(String[] args) {
System.out.println("Hello, World!");
}
```
`` echo "Hello, World!" ```
The last code block will be treated by MDAnki as Bash code. The default language can be configured by specifying --config with an appropriate defaultLanguage setting .
Note!Creating a block without language name is not fully supported and should be eliminated in usage. Take a look at this:
echo "Code block with language name"
echo "Code block without language name"
Supported languages
MDAnki supports code highlighting for these languages:
actionscript, applescript, aspnet, bash, basic, batch, c, coffeescript, cpp, csharp, d, dart, erlang, fsharp, go, graphql, groovy, handlebars, java, json, latex, less, livescript, lua, makefile, markdown, markup-templating, nginx, objectivec, pascal, perl, php, powershell, python, r, ruby, rust, sass, scheme, smalltalk, smarty, sql, stylus, swift, typescript, vim, yaml.
Images
You can use links to image files inside markdown, MDAnki will parse them and add those images to the import collection. It's allowed to use two styles for writing images:
-
Inline
-
Reference:
User settings
Any configuration which is presented in settings file could be overwritten by specifying an external configuration file:
mdanki markdown.md aki.apkg --config path/to/config/file.js
License
MIT License, Copyright (c) 2020, Oleksandr Shlinchak.
Changelog
以上所述就是小编给大家介绍的《MDAnki – convert Markdown to Anki cards》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
x86/x64体系探索及编程
邓志 / 电子工业出版社 / 2012-10-1 / 119.00元
本书是对Intel手册所述处理器架构的探索和论证。全书共五大部分,从多个方面对处理器架构相关的知识进行了梳理介绍。书中每个章节都有相应的测试实验,所运行的实验例子都可以在真实的机器上执行。 通过阅读本书,读者应能培养自己动手实验的能力。如果再有一些OS方面的相关知识,基本上就可以写出自己简易的OS核心。 本书适合有一定的x86基础知识,且对了解处理器架构及编程感兴趣的读者阅读。一起来看看 《x86/x64体系探索及编程》 这本书的介绍吧!
UNIX 时间戳转换
UNIX 时间戳转换
RGB CMYK 转换工具
RGB CMYK 互转工具