markdown
转为anki
卡片
fork自mdanki, 结合anki-prettify优化卡片样式
npm i -g md-to-anki
$ md-to-anki --help
Usage:
$ md-to-anki <mdFile>
Commands:
<mdFile> markdown文件
For more info, run any command with the `--help` flag:
$ md-to-anki --help
Options:
-t, --target <targetFile> 输出的anki文件名 eg: "-d targe.apkg"
-c, --config <configFile> 配置文件 eg: "-c ./config.json"
-s, --theme <theme> 样式主题可选 nord/minimal/dracula (default: nord)
-d, --deckName <deckName> 卡片组名 eg: "-d Test", Default: 取md文件中的"# xx"
-h, --help Display this message
-v, --version Display version number
simple.md
# Test
## Card1
Test
## Card2
Test2
### Card3
Test3
$ md-to-anki ./simple.md -s minimal
> ✔ "Test"含卡片3张: /xxx/simple.apkg
simple.md
# Test
## Media stored in file system
There is ability to write media files in 2 styles: inline and reference.
%
Node.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside of a browser.
$ md-to-anki ./simple.md
> ✔ "Test"含卡片1张: /xxx/simple.apkg
simple.md
# Test
## Media stored in file system
There is ability to write media files in 2 styles: inline and reference.
Node.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside of a browser.
$ md-to-anki ./simple.md -s minimal
> ✔ "Test"含卡片1张: /xxx/simple.apkg
config.json
{
"card": {
// 卡片分割的正则: ##.. xxx
"separator": "(?=^#{2,}\\s)",
// 卡片正反面分割用什么字符串区分 从默认的 % 改为 &&&&
"frontBackSeparator": "&&&&"
}
}
ps: 配置文件json不能带有注释,上面仅是为了说明
simple.md
# Test
## Media stored in file system
There is ability to write media files in 2 styles: inline and reference.
&&&&
Node.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside of a browser.
$ md-to-anki ./simple.md -c ./config.json -s dracula
> ✔ "Test"含卡片1张: /xxx/simple.apkg
- 添加loading
- 更多模板主题选择