mdbook安装使用实录 - 敬YES
source link: https://www.cnblogs.com/janes/p/18026114
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
mdbook安装使用实录 - 敬YES - 博客园
随笔- 231 文章- 1 评论- 1182 阅读-
79万
mdbook是一个基于Rust的电子书系统,效果类似于gitbook。本人写图文文章一直都采用的印象笔记,但是写系列教程的情况不方便管理。因此引入mdBook,分享一下基本安装使用过程及遇到的问题。
本机环境是win11。mdBook是写的 Rust 因此需要Cargo编译
1.安装Rust
官方下载地址: https://www.rust-lang.org/zh-CN/tools/install
2.安装mdBook
cargo install mdbook
安装过程中出现错误
error: linker
link.exe
not found| = note: program not foundnote: the msvc targets depend on the msvc linker butlink.exe
was not foundnote: please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option.note: VS Code is a different product, and is not sufficient.
解决方案:安装C++生成工具。从这里下载 https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools/
安装时选择红框组件。
重新安装mdbook,搞定。
创建mdbook
1.init命令
创建第一本mdbook,执行命令行
mdbook init --title 原来你是这样的java
来看下默认生成的文档结构吧。
2.build命令
mdbook build
build命令尝试解析您的SUMMARY.md文件以了解您的书的结构并获取相应的文件。 请注意,在 SUMMARY.md 中提到但不存在的文件将会自动创建。为方便起见,渲染的输出将保持与源相同的目录结构。
3.serve命令
mdbook serve
serve 命令用于通过 HTTP 在 localhost:3000 提供服务来预览电子教程。
详细mdBook教程:
https://hellowac.github.io/mdbook-doc-zh/zh-cn/index.html
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK