Giter Club home page Giter Club logo

anki-md-template's Introduction

核心markdown解析器 👉markdown-it https://github.com/markdown-it/markdown-it

核心代码在demo.html > 不想手动创建模板,可以直接导入我上传好的牌组(./markdown.apkg),就会自动导入卡片模板了

可以解析markdown语法的anki卡片模板。

cdn 引入所需资源(使用的字节的公共库,根据自己的网络情况替换),无需任何本地媒体文件。 跟着复制代码就完事了 , 或者直接导入现成的牌组获取

👇 这个是具体操作步骤。只看这里的操作步骤就好 , 卡片模板代码已 GitHub 上为准(是最新的)。 https://www.jianshu.com/p/57b84a7a3c75 点我跳转

👇 目前的功能(有什么改进可以在 issue 里提 有能力可以自行修改提 pr)

  • 代码自动高亮

  • 全部样式风格采用github-markdown-css css 样式文件修改成自动识别系统主题(是否是暗黑模式) 以前的版本可以修改一下 cdn 地址

  • 编辑只需严格按照 markdown 语法编写,不需要输入任何 html 标签(需要 markdown-it 支持,有一些配置项我可能没开),如果想配置 html 自己去那个 anki html 编辑器里改就行。但我不建议改。

  • 应 issues 的要求 加入了 对 anki mathJax 的兼容 (就是点他 anki 自带的编辑器的那个 fx 的图标)

  • 已经更新支持 自动识别系统主题 自动切换 md 渲染卡片的白天或者夜间模式

  • 图片直接截图或者保存 cv 就行

  • html 字符反转义


缺陷

1.代码段中输入的空格会被 markdown 转义 直接输出 nbsp; (修复)


cdn 仓库(慢的可以自己换成国内的 cdn 仓库换成字节的 cdn 库了国内速度挺快)


如果样式或者解析失效

可能是网络的问题,因为是采用 cdn 加载资源 不是本地 可以反复刷新 或者 切换网络尝试修复一下 或者把梯子关了(或者自己设置规则) 因为默认用的是字节的cdn库

卡片模板创建新手指引(或直接导入现成的 markdown.apkg 牌组)

  1. 正面模板内容
<div class="md-content">
{{Front}}
</div>

 <script>
 // 这里复制demo.html中的script内容
 </script>
  1. 背面内容模板
{{FrontSide}}

<div class="md-content">{{Back}}</div>
  1. 样式

复制 ./卡片样式.css 文件的内容

anki-md-template's People

Contributors

aote777 avatar lemonprefect avatar otraveler 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

Watchers

 avatar

anki-md-template's Issues

导入了您上传好的牌组,使用该牌组中模板生成卡片,代码块中有时会出现&nbsp问题,具体问题如下

这是anki的答案显示情况:
image
代码块1是我从网上复制的代码 先复制到我的markdown编辑器里,再导入到anki里面,
我发现行首的空格和中间的空格都出现了&nbsp,行尾的空格没有显示成&nbsp
然后我重新创建了一个代码块2,把代码块1里面的代码复制到代码块2中,然后把空格都删除了,再手打空格补上,导入到anki,发现我删除再手动打上的空格都正常显示了。
这样无法正常使用,记笔记需要从别的地方复制代码到卡片,不可能都手打代码,请您帮我看看是模板的未知bug还是我哪里出错了,万分感谢。
原代码块1的内容如下:

select  
  a.userkey,  
  a.idno,  
  a.phone,  
  a.name,  
  b.user_active_at,  
  c.intend_commodity,  
  c.intend_rank,  
  d.order_num,  
  d.order_amount  
from user_info a  
left join user_active b on a.userkey = b.userkey  
left join user_intend c on a.phone = c.phone  
left join user_order d on nvl(a.idno,concat(rand(),'idnumber')) = d.idno;

[help] problem of escaping spaces in Markdown

While reading README, I noticed that you solved the problem of escaping spaces in Markdown. I'm currently in a similar situation, so I'd like to ask you how to fix it.

代码段中输入的空格会被 markdown 转义 直接输出 nbsp;

Thank you so much!

缩进的代码块不能正常显示

在电脑端的anki中,添加以下缩进的代码块会显示不正常。但在手机端ankidroid中进行添加时缩进代码块是正常的。

4. **执行 SQL 语句**:
   使用游标对象的 `execute()` 方法执行 SQL 语句。
   ```python
   sql = "SELECT * FROM your_table"
   cursor.execute(sql)
   ```

显示结果:
image

备注:
image

请求支持夜间模式和MathJax公式渲染

MathJax

使用此模板后,原本anki的KaTeX也无法正常渲染了,请问能否解决这个问题,或支持MathJax渲染。

夜间模式

能否支持使用github夜间模式下的Markdown样式。

谢谢

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.