docs: 初始化项目文档和贡献者指南

添加基础文档结构包括 SUMMARY.md、book.toml 和代码行为准则
配置 Gitea 工作流实现文档自动构建和部署
This commit is contained in:
李东云
2025-06-05 14:42:51 +08:00
parent 12601285d1
commit a5a0195040
6 changed files with 215 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
name: Build and Deploy Dao OS Docs
on:
push:
branches:
- main # 当推送到 main 分支时触发
jobs:
build-and-deploy:
runs-on: ubuntu-latest # 或者你的 Gitea Actions 运行器
steps:
- name: Checkout repository
uses: actions/checkout@v4 # 使用最新的 checkout action
- name: Install mdBook
run: |
RUSTUP_TOOLCHAIN=stable cargo install mdbook --locked --no-default-features # 只安装 mdbook不安装额外特性以加速
- name: Build mdBook
run: mdbook build # 构建文档到默认的 'book' 目录
- name: Deploy to Gitea Pages
# 这里需要以 root 权限访问 Gitea PAGES_ROOT
# 实际部署时可能需要 SSH 密钥、或 Gitea Runner 特殊权限,
# 或者 Gitea Actions 提供了官方的 Pages 部署 action
# 假设你的 Gitea Runner 有权限写入 /root/gitea/gitea/data/pages/dao-os/dao-os-docs/
run: |
# 清理旧的 docs 目录
sudo rm -rf /root/gitea/gitea/data/pages/dao-os/dao-os-docs/*
# 复制新构建的文档
sudo cp -r book/* /root/gitea/gitea/data/pages/dao-os/dao-os-docs/
env:
# 你可能需要在这里配置 SSH 密钥或其他凭据,以便 Gitea Runner 有权限写入目标目录
# GITEA_SSH_KEY: ${{ secrets.GITEA_SSH_KEY }}
# 确保 Gitea Runner 运行用户拥有 /root/gitea/gitea/data/pages/ 的写入权限
# 或者,如果你使用官方的 Pages 部署 action则无需手动 cp

0
.gitignore vendored Normal file
View File

72
CODE_OF_CONDUCT-CN.md Normal file
View File

@@ -0,0 +1,72 @@
# 贡献者契约行为准则
[English](CODE_OF_CONDUCT.md)
## 我们的承诺
作为社区成员、贡献者和领导者,我们承诺:让每个人都能在我们的社区中获得免受骚扰的体验,无论其年龄、体型、可见或不可见的残疾、种族、性特征、性别认同和表达、经验水平、教育程度、社会经济地位、国籍、个人外貌、种族、宗教信仰或性取向。
我们承诺以有助于开放、欢迎、多元、包容和健康的社区的方式行事和互动。
## 我们的标准
有助于为社区创造积极环境的行为示例包括:
* 对他人的同情和友善
* 尊重不同的意见、观点和经验
* 给出并欣然接受建设性的反馈
* 对因我们的错误而受到影响的人承担责任并道歉,并从中吸取教训
* 专注于不仅对我们个人而言是最好的,而且对整个社区也是最好的
不可接受的行为示例包括:
* 使用性化语言或图像,以及任何形式的性关注或性挑逗
* 挑衅、侮辱性或贬损性评论,以及人身或政治攻击
* 公开或私下骚扰
* 未经他人明确许可,发布他人的私人信息,例如实际地址或电子邮件地址
* 在专业环境中,其他可合理地被认为不当的行为
## 执行责任
社区领导者负责明确和执行我们可接受的行为标准,并对他们认为不适当、威胁性、冒犯性或有害的任何行为采取适当和公平的纠正措施。
社区领导者有权也有责任删除、编辑或拒绝不符合本行为准则的评论、提交、代码、维基编辑、工单和其他贡献,并将在适当时候传达审查决定的理由。
## 范围
本行为准则适用于所有社区空间,也适用于个人在公共场合正式代表社区时。代表我们社区的例子包括使用官方电子邮件地址、通过官方社交媒体账户发布内容,或作为指定代表参加线上或线下活动。
## 执行指南
社区领导者将遵循以下社区影响指南来确定任何被他们认为违反本行为准则的行为的后果:
### 1. 纠正
**社区影响**:使用不当语言或其他被认为不专业或不受社区欢迎的行为。
**后果**:社区领导者发出私人书面警告,明确违反的性质并解释为何该行为不当。可能会要求公开道歉。
### 2. 警告
**社区影响**:通过单一事件或一系列行为造成的违规。
**后果**:附带后续行为后果的警告。此警告没有时间限制,但要求个人改变行为。在指定时间内,禁止与相关人员进行任何互动,包括未经请求地与执行行为准则的人员进行互动。这包括避免在社区空间以及社交媒体等外部渠道进行互动。违反这些条款可能导致暂时或永久禁言。
### 3. 暂时禁言
**社区影响**:严重违反社区标准,包括持续的不当行为。
**后果**:在指定时间内,禁止与社区进行任何形式的互动或公开交流。在此期间,禁止与相关人员进行任何公开或私下互动,包括未经请求地与执行行为准则的人员进行互动。违反这些条款可能导致永久禁言。
### 4. 永久禁言
**社区影响**:表现出持续违反社区标准的模式,包括持续的不当行为、对个人的骚扰,或对某类人的攻击或贬低。
**后果**:永久禁止与社区进行任何形式的互动或公开交流。
## 归属
本行为准则改编自 [Contributor Covenan][homepage] 2.1 版,可在 [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1] 获取。
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

72
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,72 @@
# Contributor Covenant Code of Conduct
[中文](CODE_OF_CONDUCT-CN.md)
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of actions.
**Consequence**: A warning with consequences for continued behavior. There is no time limit to this warning, but the individual is expected to change behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interaction in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the involved people, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of interaction or public communication with the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

15
book.toml Normal file
View File

@@ -0,0 +1,15 @@
[book]
title = "Dao OS Documentation"
description = "Official documentation portal for the Dao Operating System Project."
authors = ["Dao OS Project"]
language = "en" # 默认语言,也可以配置多语言
multilingual = true # 如果未来支持多语言文档
[output.html]
git-repository-url = "https://nest.doylee.cn/dao-os/dao-os-docs" # 指向你的 Gitea 仓库
edit-url-template = "https://nest.doylee.cn/dao-os/dao-os-docs/src/{path}" # 允许直接编辑源文件
copy-fonts = true
additional-css = ["./theme/custom.css"] # 可选:自定义样式
[output.html.playground] # 如果你有可运行的代码示例
runnable = true

20
src/SUMMARY.md Normal file
View File

@@ -0,0 +1,20 @@
# Summary
[简介](index.md)
[项目愿景](vision.md)
[架构概览](architecture.md)
[快速入门](getting-started.md)
---
## 子项目文档
* [meta-unit-core 文档](https://mask.doylee.cn/dao-os/meta-unit-core/)
* [meta-unit-proto 文档](https://mask.doylee.cn/dao-os/meta-unit-proto/)
* [Avatar Host 文档](https://mask.doylee.cn/dao-os/avatar-host-rust-cli/) (假设存在)
* ---
## 贡献者指南
* [行为准则](CODE_OF_CONDUCT.md)
* [贡献指南](CONTRIBUTING.md)