main
黄海 1 year ago
parent b223e0b246
commit 019d09004d

@ -5,7 +5,7 @@ https://markmap.js.org/repl
https://nodejs.org/en/download
(1) windows 直接下载最新版本安装即可
(2) linux下
(2) linux下
# 安装
wget https://nodejs.org/dist/v20.11.1/node-v20.11.1-linux-x64.tar.xz
@ -21,9 +21,10 @@ npm i markmap-common -g
npm i markmap-lib -g
npm i markmap-view -g
npm install markmap-cli -g
npm i -g markmap-cli
3、检查是不是安装成功
markmap -V
4、转换
markmap example.md -o out.html --no-open
markmap example.md -o out.html --no-open

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Markmap</title>
<style>
* {
margin: 0;
padding: 0;
}
#mindmap {
display: block;
width: 100vw;
height: 100vh;
}
</style>
<link rel="stylesheet" href="https://unpkg.com/markmap-toolbar@0.16.0/dist/style.css">
</head>
<body>
<svg id="mindmap"></svg>
<script src="https://unpkg.com/d3@7.8.5/dist/d3.min.js"></script><script src="https://unpkg.com/markmap-view@0.16.0/dist/browser/index.js"></script><script src="https://unpkg.com/markmap-toolbar@0.16.0/dist/index.js"></script><script>((r) => {
setTimeout(r);
})(() => {
const { markmap, mm } = window;
const toolbar = new markmap.Toolbar();
toolbar.attach(mm);
const el = toolbar.render();
el.setAttribute("style", "position:absolute;bottom:20px;right:20px");
document.body.append(el);
})</script><script>((getMarkmap, getOptions, root2, jsonOptions) => {
const markmap = getMarkmap();
window.mm = markmap.Markmap.create(
"svg#mindmap",
(getOptions || markmap.deriveOptions)(jsonOptions),
root2
);
})(() => window.markmap,null,{"content":"初中物理八年级上(人教版)","children":[{"content":"第一章  机械运动","children":[{"content":"第1节 长度和时间的测量","children":[{"content":"第2节 运动的描述","children":[{"content":"第3节 运动的快慢","children":[],"payload":{"lines":"4,5"}}],"payload":{"lines":"3,4"}}],"payload":{"lines":"2,3"}},{"content":"第4节 测量平均速度","children":[{"content":"本章复习","children":[],"payload":{"lines":"6,7"}}],"payload":{"lines":"5,6"}}],"payload":{"lines":"1,2"}},{"content":"第二章  声现象","children":[{"content":"第1节 声音的产生与传播","children":[{"content":"第2节 声音的特性","children":[{"content":"第3节 声的利用","children":[],"payload":{"lines":"11,12"}}],"payload":{"lines":"10,11"}}],"payload":{"lines":"9,10"}},{"content":"第4节 噪音的危害和控制","children":[{"content":"本章复习","children":[],"payload":{"lines":"13,14"}}],"payload":{"lines":"12,13"}}],"payload":{"lines":"8,9"}},{"content":"第三章  物态变化","children":[{"content":"第1节 温度","children":[{"content":"第2节 熔化和凝固","children":[{"content":"第3节 汽化和液化","children":[],"payload":{"lines":"18,19"}}],"payload":{"lines":"17,18"}}],"payload":{"lines":"16,17"}},{"content":"第4节 升华和凝华","children":[{"content":"本章复习","children":[],"payload":{"lines":"20,21"}}],"payload":{"lines":"19,20"}}],"payload":{"lines":"15,16"}},{"content":"第四章  光现象","children":[{"content":"第1节 光的直线传播","children":[{"content":"第2节 光的反射","children":[{"content":"第3节 平面镜成像","children":[],"payload":{"lines":"25,26"}}],"payload":{"lines":"24,25"}}],"payload":{"lines":"23,24"}},{"content":"第4节 光的折射","children":[{"content":"第5节 光的色散","children":[{"content":"本章复习","children":[],"payload":{"lines":"28,29"}}],"payload":{"lines":"27,28"}}],"payload":{"lines":"26,27"}}],"payload":{"lines":"22,23"}},{"content":"第五章  透镜及其应用","children":[{"content":"第1节 透镜","children":[{"content":"第2节 生活中的透镜","children":[{"content":"第3节 凸透镜成像的规律","children":[],"payload":{"lines":"33,34"}}],"payload":{"lines":"32,33"}}],"payload":{"lines":"31,32"}},{"content":"第4节 眼睛和眼镜","children":[{"content":"第5节 显微镜和望远镜","children":[{"content":"本章复习","children":[],"payload":{"lines":"36,37"}}],"payload":{"lines":"35,36"}}],"payload":{"lines":"34,35"}}],"payload":{"lines":"30,31"}},{"content":"第六章  质量与密度","children":[{"content":"第1节 质量","children":[{"content":"第2节 密度","children":[{"content":"第3节 测量物质的密度","children":[],"payload":{"lines":"41,42"}}],"payload":{"lines":"40,41"}}],"payload":{"lines":"39,40"}},{"content":"第4节 密度与社会生活","children":[{"content":"本章复习","children":[],"payload":{"lines":"43,44"}}],"payload":{"lines":"42,43"}}],"payload":{"lines":"38,39"}},{"content":"期中复习","children":[],"payload":{"lines":"45,46"}},{"content":"期末复习","children":[],"payload":{"lines":"47,48"}},{"content":"本册复习","children":[],"payload":{"lines":"49,50"}}],"payload":{"lines":"0,1"}},null)</script>
</body>
</html>

@ -1,19 +1,25 @@
package UnitTest;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.RuntimeUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.io.File;
/*
https://markmap.js.org/repl
https://github.com/markmap/markmap
*/
public class Swdt {
public static void main(String[] args) {
String workingPath = "D:\\dsWork\\QingLong\\src\\main\\java\\UnitTest";
String workingPath = "D:\\dsWork\\QingLong\\src\\main\\java\\UnitTest\\";
String km = "初中物理八年级上(人教版)";
String sourceJson = "Swdt.json";
String targetMd = "Swdt.md";
String targetHtml = "Swdt.html";
String json = FileUtil.readUtf8String(new File(workingPath + "\\" + sourceJson));
String json = FileUtil.readUtf8String(new File(workingPath + sourceJson));
JSONObject jsonObject = JSONObject.parseObject(json);
JSONArray jTree = jsonObject.getJSONObject("data").getJSONArray("tree");
String res = "# " + km + "\n";
@ -33,6 +39,15 @@ public class Swdt {
res += "\n";
}
//写入md文件
FileUtil.writeUtf8String(res, workingPath + "\\" + targetMd);
FileUtil.writeUtf8String(res, workingPath + targetMd);
//markmap Swdt.md -o Swdt.html --no-open
String osName = System.getProperty("os.name");
String cmd = "markmap " + workingPath + targetMd + " -o " + workingPath + targetHtml + " --no-open";
if (osName.startsWith("Windows")) {
cmd = "cmd /c " + cmd;
}
String str = RuntimeUtil.execForStr(cmd);
System.out.println(str);
}
}

@ -1,45 +0,0 @@
---
markmap:
colorFreezeLevel: 2
---
# markmap
## 第一章 ![](https://www.adobe.com/content/dam/cc/icons/adobe-firefly-logo-1.svg)
- [Website](https://markmap.js.org/)
- [GitHub](https://github.com/gera2ld/markmap)
## Related Projects
- [coc-markmap](https://github.com/gera2ld/coc-markmap) for Neovim
- [markmap-vscode](https://marketplace.visualstudio.com/items?itemName=gera2ld.markmap-vscode) for VSCode
- [eaf-markmap](https://github.com/emacs-eaf/eaf-markmap) for Emacs
## Features
Note that if blocks and lists appear at the same level, the lists will be ignored.
### Lists
- **strong** ~~del~~ *italic* ==highlight==
- `inline code`
- [x] checkbox
- Katex: $x = {-b \pm \sqrt{b^2-4ac} \over 2a}$ <!-- markmap: fold -->
- [More Katex Examples](#?d=gist:af76a4c245b302206b16aec503dbe07b:katex.md)
- Now we can wrap very very very very long text based on `maxWidth` option
### Blocks
```js
console('hello, JavaScript')
```
| Products | Price |
|-|-|
| Apple | 4 |
| Banana | 2 |
![](/favicon.png)

@ -1,3 +0,0 @@
https://markmap.js.org/repl
https://github.com/markmap/markmap
Loading…
Cancel
Save