6

mdbook安装使用实录 - 敬YES

 6 months ago
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.
neoserver,ios ssh client

mdbook安装使用实录 - 敬YES - 博客园

敬YES

一个宝藏程序员姐姐

随笔- 231  文章- 1  评论- 1182  阅读-

79万 

mdbook是一个基于Rust的电子书系统,效果类似于gitbook。本人写图文文章一直都采用的印象笔记,但是写系列教程的情况不方便管理。因此引入mdBook,分享一下基本安装使用过程及遇到的问题。

本机环境是win11。mdBook是写的 Rust 因此需要Cargo编译

1.安装Rust

官方下载地址: https://www.rust-lang.org/zh-CN/tools/install

37001-20240221195855959-957447900.png

2.安装mdBook

cargo install mdbook

安装过程中出现错误

37001-20240221195913822-1254755690.png

error: linker link.exe not found|  = note: program not foundnote: the msvc targets depend on the msvc linker but link.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/
安装时选择红框组件。

37001-20240221195924056-641763498.png

重新安装mdbook,搞定。

37001-20240221195935040-1379738313.png

创建mdbook

1.init命令

创建第一本mdbook,执行命令行

mdbook init --title 原来你是这样的java
37001-20240221195947187-849408292.png

来看下默认生成的文档结构吧。

37001-20240221195957787-832879566.png

2.build命令

mdbook build

build命令尝试解析您的SUMMARY.md文件以了解您的书的结构并获取相应的文件。 请注意,在 SUMMARY.md 中提到但不存在的文件将会自动创建。为方便起见,渲染的输出将保持与源相同的目录结构。

37001-20240221200011055-425779060.png

3.serve命令

mdbook serve

serve 命令用于通过 HTTP 在 localhost:3000 提供服务来预览电子教程。

37001-20240221224111498-1906168844.png

详细mdBook教程:
https://hellowac.github.io/mdbook-doc-zh/zh-cn/index.html

posted on 2024-02-21 22:45  敬YES  阅读(123)  评论(0)  编辑  收藏  举报

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK