/programming_anatomy_in_rust

以rust为例分享学习编程常考虑的方方面面

Primary LanguageRustMIT LicenseMIT

编程解剖 in rust

以rust为例分享学习编程常考虑的方方面面

本地运行

cargo install mdbook
mdbook serve

git lfs配置

git lfs install 
git lfs track '*.img'

项目基础结构

{{#check | }}

  1. 每个文件夹下的同名md文件介绍当前文件夹的内容
  2. 关于待完成内容:主要基于mdbook-checklist插件
    - [待完成](checklist.md) 
  1. 添加待完成锚点的格式

check空格之后的内容不能有空格, 且只能为英文 " | "之后的内容可以有空格,可以为中文

{{#check Note-1 | This is an important note}}
  • checklist页面渲染效果:
- <SUMMARY对应标题名>
    - [This is an important note](Note-1)

这种写法会自动在本地生成md文件:src/checklist.md, 但是不用管它,最后渲染还是以mdbook-checklist的内容为准

用到的工具

来自:Mdbook - Apple Power User

mdbook-checklist: 整理待办事项

ANSSI-FR/mdbook-checklist: mdbook preprocessor for generating checklists and indexes

cargo install mdbook-checklist

mdbook-checklist - crates.io: Rust Package Registry

mdbook-pagetoc: 添加业内目录

JorelAli/mdBook-pagetoc: A page table of contents for mdBook

mdbook-admonish: 使用新的css文件

相关资源

All supported directives are listed below.

特别语法

自定义标题
The following steps can lead to irrecoverable data corruption.
内嵌代码
This syntax won't work in Python 3:
```python
print "Hello, world!"
```
自定义样式
Styled with my custom CSS class.
可折叠
Content will be hidden initially.

常用格式

note
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
abstract, summary, tldr
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
info, todo
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
tip, hint, important
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
success, check, done
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
question, help, faq
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
warning, caution, attention
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
failure, fail, missing
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
danger, error
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
bug
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
example
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
quote, cite
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.

github action

> [Access Token | Code Cookbook](https://michaelcurrin.github.io/code-cookbook/recipes/ci-cd/github-actions/tokens/access-token.html)
1. 设置token:[Personal access tokens](https://github.com/settings/tokens)
2. 给指定repository设置secret:repository -> settings -> secrets -> Actions
3. 新建一个名为**GH_MD_TOC**的repository secret,将第一步的token设置进去
4. 将这个secret设置为action环境变量