Skip to content

添加docfx支持,以便于将文档生成为带目录的PDF文档 #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
book
.idea
_site
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ $ mdbook serve

为了能够运行这些示例,你必须要连接到网络;当然你可以离线阅读所有这些内容。

## 生成PDF格式的离线文档

兼容Docfx文档工具,可以使用 [Docfx](https://dotnet.github.io/docfx/index.html) 来生成本地离线文档,本项目已经添加docfx配置,不影响mdbook工具,可以直接使用下面的命令打开docfx生成的文档页面以及生成PDF格式离线文档(带目录的PDF文件)。
```bash
docfx docfx.json --serve -p 8900
```

## 如何贡献

请查看 [CONTRIBUTING.md][how-to-contribute] 文件了解详细内容。
Expand Down
33 changes: 33 additions & 0 deletions docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json",
"build": {
"content": [
{
"files": [
"**/*.{md,yml}"
],
"exclude": [
"_site/**"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"output": "_site",
"template": [
"default",
"modern"
],
"globalMetadata": {
"_appName": "\u901A\u8FC7\u4F8B\u5B50\u5B66\u4E60Rust - by docfx",
"_appTitle": "\u901A\u8FC7\u4F8B\u5B50\u5B66\u4E60Rust - by docfx",
"_enableSearch": true,
"pdf": true
}
}
}
11 changes: 11 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
_layout: landing
---

# This is the **HOMEPAGE**.

Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.

## Quick Start Notes:

1. Add images to the *images* folder if the file is referencing an image.
Loading