Compare commits
2 Commits
3185864cef
...
7607fb89a9
| Author | SHA1 | Date |
|---|---|---|
|
|
7607fb89a9 | |
|
|
580f442c57 |
|
|
@ -1,8 +0,0 @@
|
||||||
# 默认忽略的文件
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# 基于编辑器的 HTTP 客户端请求
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="WEB_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/anki-md-template.iml" filepath="$PROJECT_DIR$/.idea/anki-md-template.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
|
|
@ -16,17 +16,15 @@
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"
|
href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"
|
||||||
/>
|
/>
|
||||||
<!-- 添加MathJax配置 -->
|
<link
|
||||||
<script type="text/x-mathjax-config">
|
rel="stylesheet"
|
||||||
MathJax.Hub.Config({
|
href="https://cdn.jsdelivr.net/npm/markdown-it-texmath@1.0.0/css/texmath.min.css"
|
||||||
tex2jax: {
|
/>
|
||||||
inlineMath: [['$','$']],
|
<link
|
||||||
displayMath: [['$$','$$']],
|
rel="stylesheet"
|
||||||
processEscapes: true
|
href="https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css"
|
||||||
}
|
/>
|
||||||
});
|
<title>anki-md模板测试(chrome等浏览器开发测试即可)</title>
|
||||||
</script>
|
|
||||||
<title>anki-md模板测试</title>
|
|
||||||
</head>
|
</head>
|
||||||
<style>
|
<style>
|
||||||
.markdown-body {
|
.markdown-body {
|
||||||
|
|
@ -54,15 +52,19 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
<div class="md-content">
|
<div class="md-content">
|
||||||
这是一个行内公式
|
行内公式:$E=mc^2$
|
||||||
$$E=mc^2$$
|
***
|
||||||
和一个块级公式
|
块级公式:
|
||||||
$$\\frac{d}{dx}(x^n) = nx^{n-1}$$
|
$$\frac{d}{dx}(x^n) = nx^{n-1}$$
|
||||||
|
***
|
||||||
|
矩阵:
|
||||||
|
$$\begin{pmatrix} a & b \\ c & d \end{pmatrix}$$
|
||||||
|
***
|
||||||
|
积分:
|
||||||
|
$$\int_{a}^{b} f(x) \, dx$$
|
||||||
***
|
***
|
||||||
> 呵呵呵
|
> 呵呵呵
|
||||||
|
|
||||||
> 喜喜
|
|
||||||
|
|
||||||
# 一级标题
|
# 一级标题
|
||||||
## 二级标题
|
## 二级标题
|
||||||
### 三级标题
|
### 三级标题
|
||||||
|
|
@ -74,12 +76,8 @@ $$\\frac{d}{dx}(x^n) = nx^{n-1}$$
|
||||||
> 引用
|
> 引用
|
||||||
---
|
---
|
||||||
- 无序列表
|
- 无序列表
|
||||||
- 无序列表
|
|
||||||
- 无序列表
|
|
||||||
---
|
---
|
||||||
1. 有序列表
|
1. 有序列表
|
||||||
2. 有序列表
|
|
||||||
3. 有序列表
|
|
||||||
---
|
---
|
||||||
[链接](https://www.baidu.com)
|
[链接](https://www.baidu.com)
|
||||||
---
|
---
|
||||||
|
|
@ -101,14 +99,12 @@ console.log('hello world')
|
||||||
getScript(
|
getScript(
|
||||||
"https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/highlight.js/11.4.0/highlight.min.js"
|
"https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/highlight.js/11.4.0/highlight.min.js"
|
||||||
),
|
),
|
||||||
// 添加markdown-it-texmath插件
|
|
||||||
getScript(
|
getScript(
|
||||||
"https://cdn.jsdelivr.net/npm/markdown-it-texmath/texmath.min.js"
|
"https://cdn.jsdelivr.net/npm/markdown-it-texmath@1.0.0/texmath.min.js"
|
||||||
),
|
),
|
||||||
// 添加MathJax
|
|
||||||
getScript(
|
getScript(
|
||||||
"https://cdn.bootcdn.net/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js"
|
"https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.js"
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
// 加载资源并初始化
|
// 加载资源并初始化
|
||||||
|
|
@ -172,16 +168,11 @@ console.log('hello world')
|
||||||
return ""; // use external default escaping
|
return ""; // use external default escaping
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
md.use(texmath, {
|
||||||
// 配置markdown-it-texmath插件
|
engine: katex,
|
||||||
if (window.texmath) {
|
delimiters: "dollars",
|
||||||
md.use(window.texmath, {
|
katexOptions: { macros: { "\\RR": "\\mathbb{R}" } },
|
||||||
engine: MathJax,
|
});
|
||||||
delimiters: 'dollars',
|
|
||||||
katexOptions: { macros: {"\\RR": "\\mathbb{R}"} }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
document.querySelectorAll(".md-content").forEach((div, index) => {
|
document.querySelectorAll(".md-content").forEach((div, index) => {
|
||||||
console.log("查找到的容器元素", div);
|
console.log("查找到的容器元素", div);
|
||||||
// 需要去除首尾空格 不然markdown-it会解析错误
|
// 需要去除首尾空格 不然markdown-it会解析错误
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
@import url('https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.8.1/github-markdown.min.css');
|
@import url('https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.8.1/github-markdown.min.css');
|
||||||
@import url('https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/base16/onedark.min.css');
|
@import url('https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/base16/onedark.min.css');
|
||||||
@import url('https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css');
|
@import url('https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css');
|
||||||
|
@import url('https://cdn.jsdelivr.net/npm/markdown-it-texmath@1.0.0/css/texmath.min.css');
|
||||||
|
@import url('https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css');
|
||||||
/*
|
/*
|
||||||
把这里的样式代码 ctrl a 复制到卡片模板 的样式区域
|
把这里的样式代码 ctrl a 复制到卡片模板 的样式区域
|
||||||
*/
|
*/
|
||||||
Loading…
Reference in New Issue