Skip to content

Commit

Permalink
feat: use mdbook to render book html
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangfeng.xzc committed Mar 7, 2023
1 parent 46d1864 commit ce0d6fb
Show file tree
Hide file tree
Showing 13 changed files with 238 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy Documentation

on:
workflow_dispatch:
push:
branches:
- main
paths:
- "docs/**"
- ".github/workflows/deploy-docs.yml"

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build-docs:
runs-on: ubuntu-latest
concurrency:
group: docs
steps:
- uses: actions/checkout@v3
# https://github.com/marketplace/actions/mdbook-action
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: 'latest'
- name: Build docs
run: mdbook build ./docs/en && mdbook build ./docs/zh
- name: Build agg
run: mv ./docs/en/book ./docs/agg/en && mv ./docs/zh/book ./docs/agg/zh
- name: Upload docs
uses: actions/upload-pages-artifact@v1
with:
path: ./docs/agg
deploy-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build-docs
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.idea
.DS_Store
.DS_Store
book
35 changes: 35 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# README

# Install mdBook

Download mdBook from its [release page](https://github.com/rust-lang/mdBook/releases) and put it on your `$PATH`.

Verify mdBook:
```bash
mdbook --version
```

output:
```text
mdbook v0.4.26
```

Read [mdBook Documentation](https://rust-lang.github.io/mdBook/format/summary.html)

# Write documentations

Directory structure:
```text
docs/
en/ English translation
src/
introduction/
introduction.md A documentation
SUMMARY.md A markdown which generates the sidebar menu. Check the detail here https://rust-lang.github.io/mdBook/format/summary.html
zh/ Chinese translation, has same directory structure as en/
```

The 'mdbook serve' command is used to preview a book by serving it via HTTP at `localhost:3000` by default:
```bash
mdbook serve ./docs/en
```
35 changes: 35 additions & 0 deletions docs/README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# README

# 安装 mdBook

[release page](https://github.com/rust-lang/mdBook/releases) 下载 mdBook,并将其放置在 `$PATH` 下.

验证 mdBook:
```bash
mdbook --version
```

输出:
```text
mdbook v0.4.26
```

阅读 [mdBook 文档](https://rust-lang.github.io/mdBook/format/summary.html)

# 编写文档

目录结构:
```text
docs/
en/ 英文翻译
src/
introduction/
introduction.md 一个文档
SUMMARY.md 一个 markdown 文档,用于生成侧边菜单栏. 详情请参考 mdBook 文档。
zh/ 中文翻译,与 en/ 有相同的目录结构。
```

使用 'mdbook serve' 命令在 `localhost:3000` 部署一个 HTTP 服务器用于预览渲染结果。
```bash
mdbook serve ./docs/en
```
23 changes: 23 additions & 0 deletions docs/agg/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>HoloInsight Documentations</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta charset="UTF-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff" />
</head>
<body>
<div>
<ul>
<li>
<a href="en/">HoloInsight Documentations</a>
</li>
<li>
<a href="zh/">HoloInsight 文档</a>
</li>
</ul>
</div>
</body>
</html>
8 changes: 8 additions & 0 deletions docs/en/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[book]
title = "HoloInsight Documentations"
authors = ["xzchaoo"]
language = "en"
src = "src"

[build]
create-missing = false
37 changes: 37 additions & 0 deletions docs/en/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Summary


# Introduction
- [What is HoloInsight](introduction/what-is-holoinsight.md)
- [Quick Start]()


# User Guide
- [Page Layout]()
- [Infrastructure monitoring]()
- [Integrations]()
- [Application monitoring]()
- [Log monitoring]()
- [Dashboard]()
- [Dashboard]()
- [Alert]()

# Dev Guide
- [Building]()
- [Compile]()
- [Build docker image]()
- [Running]()
- [Logging]()


# Operations
- [Deployment]()
- [Standalone/All-in-one]()
- [Microservice style]()
- [Install Agent]()
- [k8s]()
- [Troubleshooting]()


# Technical and Design

2 changes: 2 additions & 0 deletions docs/en/src/introduction/what-is-holoinsight.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# What is HoloInsight
TODO
2 changes: 2 additions & 0 deletions docs/en/src/user-guide/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# User Guide
TODO
8 changes: 8 additions & 0 deletions docs/zh/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[book]
title = "HoloInsight 文档"
authors = ["xzchaoo"]
language = "zh"
src = "src"

[build]
create-missing = false
30 changes: 30 additions & 0 deletions docs/zh/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Summary


# 介绍
- [什么是 HoloInsight](introduction/what-is-holoinsight.md)
- [快速开始]()


# 用户指南


# 开发指南
- [构建]()
- [构建二进制]()
- [构建 Docker 镜像]()
- [运行]()
- [日志]()


# 运维
- [部署]()
- [Standalone/All-in-one]()
- [微服务风格]()
- [安装 Agent]()
- [k8s]()
- [问题排除]()


# 技术架构

2 changes: 2 additions & 0 deletions docs/zh/src/introduction/what-is-holoinsight.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 什么是 HoloInsight
TODO
2 changes: 2 additions & 0 deletions docs/zh/src/user-guide/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 用户指南
TODO

0 comments on commit ce0d6fb

Please sign in to comment.