Skip to content

Commit

Permalink
添加Mkdocs文档
Browse files Browse the repository at this point in the history
  • Loading branch information
mrasea committed Mar 29, 2024
1 parent e877ae7 commit b341a99
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/hello_algo/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 介绍
2 changes: 1 addition & 1 deletion docs/hello_algo/install.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# 安装
# 安装环境
37 changes: 37 additions & 0 deletions docs/mkdocs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# MkDocs

## 介绍

[官网](https://www.mkdocs.org/)

MkDocs 是一个快速、简单且华丽的静态站点生成器,适用于构建项目文档。文档源文件是用 Markdown 编写的,并使用单个 YAML 配置文件进行配置。首先阅读介绍性教程,然后查看用户指南以获取更多信息。

## 安装

```
pip install mkdocs
```

## 创建

```
mkdocs new my-project
cd my-project
```
以上操作会新建以下结构的文件:
```
.
├─ docs/
│ └─ index.md
└─ mkdocs.yml
```

在开发时可以启动预览服务。
```
mkdocs serve
```
## 生成网站

```
mkdocs build
```
60 changes: 60 additions & 0 deletions docs/mkdocs/material.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Material for MkDocs主题

## 安装


=== "使用pip"

```
pip install mkdocs-material
```

=== "使用docker(推荐)"

```
docker pull squidfunk/mkdocs-material
```

## 创建

=== "使用pip"

```
mkdocs new .
```

=== "Unix, Powershell"

```
docker run --rm -it -v ${PWD}:/docs squidfunk/mkdocs-material new .
```

=== "Windows"

```
docker run --rm -it -v "%cd%":/docs squidfunk/mkdocs-material new .
```
## 配置
```
theme:
name: material
```

## 预览开发

=== "Unix, Powershell"

```
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material
```

=== "Windows"

```
docker run --rm -it -p 8000:8000 -v "%cd%":/docs squidfunk/mkdocs-material
```

## 生成网站

[生成网站](./index.md)
14 changes: 12 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ theme:
name: material
language: zh

markdown_extensions:
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true

nav:
- 介绍: index.md
- 介绍:
- index.md
- hello glgo 学习:
- 本地环境搭建: hello_algo/install.md
- hello_algo/index.md
- hello_algo/install.md
- MkDocs 学习:
- mkdocs/index.md
- mkdocs/material.md

0 comments on commit b341a99

Please sign in to comment.