This commit is contained in:
aote777 2024-03-05 16:31:31 +08:00
parent 6e45919a38
commit 1f1da0f654
3 changed files with 63 additions and 58 deletions

View File

@ -1,40 +1,44 @@
# anki-md-template
> **核心代码在`demo.html`中**
> **不想手动创建模板,可以直接导入我上传好的牌组(markdown.apkg),就会自动导入卡片模板了**
* 可以解析`markdown`语法的`anki`模板。cdn引入(使用的字节的公共库,根据自己的网络情况替换),无需任何本地媒体文件。
> **核心代码在`demo.html`中** > **不想手动创建模板,可以直接导入我上传好的牌组(./markdown.apkg),就会自动导入卡片模板了**
👇这个是具体操作步骤。只看这里的操作步骤就好 卡片模板代码已GitHub上为准是最新的
`https://www.jianshu.com/p/57b84a7a3c75`
# 可以解析`markdown`语法的`anki`卡片模板。
> cdn 引入所需资源(使用的字节的公共库,根据自己的网络情况替换),无需任何本地媒体文件。
> 跟着复制代码就完事了 , 或者直接导入现成的牌组获取
👇 这个是具体操作步骤。只看这里的操作步骤就好 卡片模板代码已 GitHub 上为准(是最新的)。
`https://www.jianshu.com/p/57b84a7a3c75` <a href="https://www.jianshu.com/p/57b84a7a3c75" target="_blank">跳转\_blank</a>
👇 目前的功能(有什么改进可以在 issue 里提 有能力可以自行修改提 pr
👇目前的功能有什么改进可以在issue里提
- [x] 代码自动高亮
- [x] 全部样式风格采用`github-markdown-css` css样式文件修改成自动识别系统主题是否是暗黑模式 以前的版本可以修改一下 cdn地址
- [x] 全部样式风格采用`github-markdown-css` css 样式文件修改成自动识别系统主题(是否是暗黑模式) 以前的版本可以修改一下 cdn 地址
- [x] 编辑只需严格按照markdown语法编写,不需要输入任何html标签需要showdown.js支持有一些配置项我可能没开如果想配置html自己去那个anki html编辑器里改就行。但我不建议改。
- [x] 编辑只需严格按照 markdown 语法编写,不需要输入任何 html 标签(需要 showdown.js 支持,有一些配置项我可能没开),如果想配置 html 自己去那个 anki html 编辑器里改就行。但我不建议改。
- [x] 应issues的要求 加入了 对 anki mathJax 的兼容 (就是点他anki自带的编辑器的那个 fx的图标)
- [x] 应 issues 的要求 加入了 对 anki mathJax 的兼容 (就是点他 anki 自带的编辑器的那个 fx 的图标)
- [x] 已经更新支持 自动识别系统主题 自动切换md渲染卡片的白天或者夜间模式
- [x] 已经更新支持 自动识别系统主题 自动切换 md 渲染卡片的白天或者夜间模式
* 关于图片现在的我的两种处理方式
1. 第一个我就是直接用qq截图然后`ctrl v`进去,anki会自动帮我们创建一个`<img />`导入 可以和我们的md解析共存
2. 第二个就是用markdown的语法`![]()`来用base64加密保存图片,(因为链接会被anki自动识别导入)
**对于图片我的最终方案是 直接使用qq截图或者下载的图片直接复制进去,原因是图片使用base64太长了严重干扰笔记的编辑**
- [x] 图片直接截图或者保存 cv 就行
******
- [x] pr 提了个 html 字符反转义合上去了 不需要可以自行去掉
---
**缺陷**
1.~~代码段中输入的空格会被markdown转义 直接输出nbsp;~~ (修复)
1.~~代码段中输入的空格会被 markdown 转义 直接输出 nbsp;~~ (修复)
*****
**cdn仓库(~~慢的可以自己换成国内的cdn仓库~~换成字节的cdn库了国内速度挺快)**
> 如果不生效了 可能是网络的问题,因为是采用cdn的形式 加载script标签 不是本地的形式
> 可以反复刷新 或者 切换网络尝试修复一下
---
**cdn 仓库(~~慢的可以自己换成国内的 cdn 仓库~~换成字节的 cdn 库了国内速度挺快)**
****
#### 如果样式或者解析失效
可能是网络的问题,因为是采用 cdn 加载资源 不是本地
可以反复刷新 或者 切换网络尝试修复一下
或者把梯子关了(或者自己设置规则) 因为默认用的是字节的cdn库

Binary file not shown.

View File

@ -3,20 +3,19 @@
*/
/* github样式 */
.markdown-body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
}
@media (max-width: 767px) {
.markdown-body {
padding: 15px;
}
}
.markdown-body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
}
@media (max-width: 767px) {
.markdown-body {
padding: 15px;
}
}
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
@ -31,8 +30,8 @@
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
width:100%;
height:100%;
width: 100%;
height: 100%;
}
/* Sections
@ -44,10 +43,10 @@ height:100%;
body {
margin: 0;
background:#fff;
width:100%;
height:100%;
text-align:left;
background: #fff;
width: 100%;
height: 100%;
text-align: left;
}
/**
@ -200,7 +199,8 @@ textarea {
*/
button,
input { /* 1 */
input {
/* 1 */
overflow: visible;
}
@ -210,7 +210,8 @@ input { /* 1 */
*/
button,
select { /* 1 */
select {
/* 1 */
text-transform: none;
}
@ -219,9 +220,9 @@ select { /* 1 */
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
[type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button;
}
@ -230,9 +231,9 @@ button,
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
[type='button']::-moz-focus-inner,
[type='reset']::-moz-focus-inner,
[type='submit']::-moz-focus-inner {
border-style: none;
padding: 0;
}
@ -242,9 +243,9 @@ button::-moz-focus-inner,
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
[type='button']:-moz-focusring,
[type='reset']:-moz-focusring,
[type='submit']:-moz-focusring {
outline: 1px dotted ButtonText;
}
@ -293,8 +294,8 @@ textarea {
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
[type='checkbox'],
[type='radio'] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
@ -303,8 +304,8 @@ textarea {
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
[type='number']::-webkit-inner-spin-button,
[type='number']::-webkit-outer-spin-button {
height: auto;
}
@ -313,7 +314,7 @@ textarea {
* 2. Correct the outline style in Safari.
*/
[type="search"] {
[type='search'] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
@ -322,7 +323,7 @@ textarea {
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
[type='search']::-webkit-search-decoration {
-webkit-appearance: none;
}