Skip to content

Latest commit

 

History

History
108 lines (83 loc) · 2.28 KB

File metadata and controls

108 lines (83 loc) · 2.28 KB

导入

导入并配置文档项目

1. 新建 docs 目录

在 DocMan 目录下新建一个 docs 目录,并进入该目录

mkdir docs
cd docs

2. 导入文档项目

你可以选择使用 gitscp 或其他方式将文档项目导入到 docs

  1. 使用 Git
# git,在服务器上操作
git clone xxx/my_doc
  1. 使用 scp
# scp,在本地操作
scp my_doc remote_ip:path_to_docman_docs

如果你还没有自己的文档项目,可以试试导入我们的 DocMan 官方文档

# Gitee
git clone https://gitee.com/monkeyhbd/docman-document.git

# GitHub
git clone https://github.com/monkeyhbd/docman-document.git

如果一切顺利的话,会得到以下目录结构:

docman/
 |
 |--docs/
 |   |
 |   |--my_doc/
 |
 |-- ...

3. 配置目录索引文件

文档项目的目录索引文件 index.json 定义了文档的目录结构,DocMan 根据它来生成 HTML 文件。

以 DocMan 官方文档为例,假设文档项目内有以下 Markdown 文件:

my_doc/
 |
 |--01-introduction.md
 |--02-start.md
 |--03-configuration.md
 |--04-about.md
 |--index.json

我们编写了如下目录索引文件:

{
	"title": "DocMan 官方文档",
	"describe": "DocMan 官方文档",
	"author": "Monkeyhbd",
	"list": [
		{
			"title": "DocMan 简介",
			"describe": "自由开源的文档类网站生成器",
			"path": "./01-introduction.md",
			"rename": "index"
		},
		{
			"title": "开始使用",
			"describe": "只需 4 步即可生成并部署站点",
			"path": "./02-start.md"
		},
		{
			"title": "配置",
			"describe": "DocMan 基本配置和扩展配置",
			"path": "./03-configuration.md"
		},
		{
			
			"title": "关于我们",
			"describe": "DocMan 和 DocMan 开发团队",
			"path": "./04-about.md"
		}
	]
}

describe 不是必须要定义的,它表示对文档的描述信息,如果定义了,它会显示在目录标题的下方。

rename 也可以不定义,若定义此项,DocMan 将把生成的 HTML 文件重命名为其值(默认是与 Markdown 文件同名),我们还是建议给项目的第一篇文档定义 rename"index"

我们将在后面详细的介绍目录索引文件 index.json 的记法标准,以及哪些项目是必须要定义的,哪些是可选的。