npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

md-to-anki

v0.0.23

Published

markdown to anki

Downloads

5

Readme

md-to-anki

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

Example

默认采用## xxx..分割卡片

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

可以含有代码块、图片等资源会一并打包进apkg文件

TODO

  • [x] 添加loading
  • [x] 更多模板主题选择