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