TTK: 保持批判,有所取舍,方见真我
See the codeTTK: 保持批判,有所取舍,知行合一, 方见真我
在多方面整理自己掌握的内容时,一再感受到思维工具的重要性,而这才是核心本质所在,因而起了这本书。
../../../../../layer1_visual_tools/map_tools/vega/collections/data_json/rust.json
* -> #: name<code>note content</code>:;结尾**:node name
<code>
note content
</code>;
{
"id": 3,
"color": "",
"name": "",
"link": "",
"parent": 1,
"note": ""
}
notes = [note.replace('";"', ';') for note in notes]
./scripts/local_proxy_server.js为了和mdbook的路径一致,在src目录下执行
npm install -g http-server
http-server -c-1
目前已知mdbook在github page发布后使用静态资源需要从src目录开始定位,而且要加上项目名称。也就是
/<项目名称>/<从src开始的定位>
为了本地的http-server可以兼容这个路径(因为http-server在本地的src根目录运行,静态资源不带<项目名>)
这里使用http-proxy写了一个代理:
┌─────────────┐ ┌─────────────┐
│ │ Proxy Request │ │
│ Client ├─────────────────►│ Proxy │
│ │ │ │
└───────┬─────┘ └───────┬─────┘
│ │
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ │Proxy Request with│ │
│ Proxy │ modified req.url │ Server │
│ ├─────────────────►│ │
└───────┬─────┘ └───────┬─────┘
│ │
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ │ Server Response │ │
│ Proxy │◄─────────────────┤ Server │
│ │ │ │
└─────────────┘ └─────────────┘
│ │
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ │ Proxy Response │ │
│ Client │◄─────────────────┤ Proxy │
│ │ │ │
└─────────────┘ └─────────────┘
"tooltip": {
"signal": "{'相关笔记': datum.note}"
}
def get_kroki_preprocessors():
preprocessors = {
"puml": "plantuml",
"seqdiag": "sequediag",
"svgbob": "svgbob",
"ditaa": "ditaa",
}
return preprocessors
# 将puml/mermaid等内容提交给kroki获取在线图片链接
def get_kroki_link(file_path, preprocessor):
with open(file_path, 'r') as f:
content = f.read()
encoded_cotnent = base64.urlsafe_b64encode(zlib.compress(content.encode('utf8'))).decode('utf8')
return f"https://kroki.io/{preprocessor}/svg/{encoded_cotnent}"
可以去kroki在线编辑网站测试好后保存文本在本地:Kroki!
221 commits
Roff
73.9%
JavaScript
7.2%
HTML
6.8%
CSS
5.4%
Handlebars
1.9%
Shell
1.9%
Rust
1.6%
Python
1.2%
TTK: 保持批判,有所取舍,方见真我
See the codeTTK: 保持批判,有所取舍,知行合一, 方见真我
在多方面整理自己掌握的内容时,一再感受到思维工具的重要性,而这才是核心本质所在,因而起了这本书。
../../../../../layer1_visual_tools/map_tools/vega/collections/data_json/rust.json
* -> #: name<code>note content</code>:;结尾**:node name
<code>
note content
</code>;
{
"id": 3,
"color": "",
"name": "",
"link": "",
"parent": 1,
"note": ""
}
notes = [note.replace('";"', ';') for note in notes]
./scripts/local_proxy_server.js为了和mdbook的路径一致,在src目录下执行
npm install -g http-server
http-server -c-1
目前已知mdbook在github page发布后使用静态资源需要从src目录开始定位,而且要加上项目名称。也就是
/<项目名称>/<从src开始的定位>
为了本地的http-server可以兼容这个路径(因为http-server在本地的src根目录运行,静态资源不带<项目名>)
这里使用http-proxy写了一个代理:
┌─────────────┐ ┌─────────────┐
│ │ Proxy Request │ │
│ Client ├─────────────────►│ Proxy │
│ │ │ │
└───────┬─────┘ └───────┬─────┘
│ │
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ │Proxy Request with│ │
│ Proxy │ modified req.url │ Server │
│ ├─────────────────►│ │
└───────┬─────┘ └───────┬─────┘
│ │
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ │ Server Response │ │
│ Proxy │◄─────────────────┤ Server │
│ │ │ │
└─────────────┘ └─────────────┘
│ │
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ │ Proxy Response │ │
│ Client │◄─────────────────┤ Proxy │
│ │ │ │
└─────────────┘ └─────────────┘
"tooltip": {
"signal": "{'相关笔记': datum.note}"
}
def get_kroki_preprocessors():
preprocessors = {
"puml": "plantuml",
"seqdiag": "sequediag",
"svgbob": "svgbob",
"ditaa": "ditaa",
}
return preprocessors
# 将puml/mermaid等内容提交给kroki获取在线图片链接
def get_kroki_link(file_path, preprocessor):
with open(file_path, 'r') as f:
content = f.read()
encoded_cotnent = base64.urlsafe_b64encode(zlib.compress(content.encode('utf8'))).decode('utf8')
return f"https://kroki.io/{preprocessor}/svg/{encoded_cotnent}"
可以去kroki在线编辑网站测试好后保存文本在本地:Kroki!
221 commits
Roff
73.9%
JavaScript
7.2%
HTML
6.8%
CSS
5.4%
Handlebars
1.9%
Shell
1.9%
Rust
1.6%
Python
1.2%