generated from teedoc/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2a6ca42
Showing
39 changed files
with
862 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: publish pages | ||
|
||
# permit push op | ||
permissions: | ||
contents: write | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the main branch | ||
push: | ||
branches: [ main ] | ||
# pull_request: | ||
# branches: [ main ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
# Runs a set of commands using the runners shell | ||
- name: build doc | ||
id: build_doc | ||
run: | | ||
pip3 install setuptools | ||
pip3 install teedoc | ||
if [ -d "~/.local/bin/" ];then | ||
export PATH=~/.local/bin/:$PATH | ||
fi | ||
commit_info=`git describe --all --always --long` | ||
teedoc install | ||
teedoc build | ||
out_dir=out`python3 -c 'import json; f=open("site_config.json");config=json.load(f);print(config["site_root_url"])'` | ||
cp -rf .github $out_dir | ||
echo ::set-output name=out_dir::$out_dir | ||
- name: Deploy 🚀 to github pages | ||
uses: JamesIves/[email protected] | ||
with: # more usage visit https://github.com/JamesIves/github-pages-deploy-action | ||
branch: gh-pages # The branch the action should deploy to. | ||
folder: ${{ steps.build_doc.outputs.out_dir }} # The folder the action should deploy. | ||
|
||
# mannually scripts | ||
# cd $out_dir | ||
# git init | ||
# git config user.name ${{ secrets.GIT_NAME }} | ||
# git config user.email ${{ secrets.GIT_EMAIL }} | ||
# git remote add upstream "[email protected]:${{ secrets.REPO }}.git" | ||
# git add -A | ||
# git commit -m "rebuild website ad $commit_info" | ||
# SSHPATH="$HOME/.ssh" | ||
# rm -rf "$SSHPATH" | ||
# mkdir -p "$SSHPATH" | ||
# echo "${{ secrets.ACCESS_KEY }}" > "$SSHPATH/id_rsa" | ||
# chmod 600 "$SSHPATH/id_rsa" | ||
# sudo sh -c "echo StrictHostKeyChecking no >>/etc/ssh/ssh_config" | ||
# git push upstream HEAD:gh-pages --force | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: test build linux macos | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the main branch | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
strategy: | ||
max-parallel: 5 | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] # must use str, not int, or 3.10 will be recognized as 3.1 | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
# Runs a set of commands using the runners shell | ||
- name: build doc | ||
id: build_doc | ||
run: | | ||
pip3 install setuptools | ||
pip3 install teedoc | ||
if [ -d "~/.local/bin/" ];then | ||
export PATH=~/.local/bin/:$PATH | ||
fi | ||
teedoc install | ||
teedoc build | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: test build windows | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the main branch | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
strategy: | ||
max-parallel: 5 | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] # must use str, not int, or 3.10 will be recognized as 3.1 | ||
runs-on: windows-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
# Runs a set of commands using the runners shell | ||
- name: build doc | ||
id: build_doc | ||
run: | | ||
pip3 install setuptools | ||
pip3 install teedoc | ||
teedoc install | ||
teedoc build | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
out | ||
build | ||
temp | ||
__pycache__ | ||
*.egg-info | ||
dist | ||
.vscode | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 teedoc | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
teedoc website template | ||
===== | ||
|
||
**[中文 README](./README_ZH.md) | English README** | ||
|
||
|
||
|
||
This template supported by teedoc, visit: [teedoc.neucrack.com](https://teedoc.neucrack.com/) or [teedoc.github.io](https://teedoc.github.io) learn more | ||
|
||
|
||
## build locally | ||
|
||
* Install python3 | ||
|
||
On `Windows` or `macOS`, download from [python.org](https://www.python.org/downloads/) | ||
|
||
On `Linux`, `Ubuntu` for example: | ||
|
||
``` | ||
sudo apt install python3 python3-pip | ||
``` | ||
|
||
* Install teedoc | ||
|
||
This command will **install teedoc program** | ||
|
||
``` | ||
pip3 install teedoc | ||
``` | ||
|
||
* Initialize document | ||
|
||
``` | ||
mkdir my_site | ||
cd my_site | ||
teedoc init | ||
``` | ||
|
||
or | ||
|
||
``` | ||
teedoc -d my_site init | ||
``` | ||
|
||
* Install plugins | ||
|
||
This command will **install plugins** used by doc(set in `site_config.json`) | ||
|
||
``` | ||
cd my_site | ||
teedoc install | ||
``` | ||
|
||
* build or serve | ||
|
||
``` | ||
teedoc serve | ||
``` | ||
|
||
then visit [http://127.0.0.1:2333](http://127.0.0.1:2333) in browser | ||
|
||
If you only want to generate htmls: | ||
|
||
``` | ||
teedoc build | ||
``` | ||
|
||
|
||
## Create your website on github pages in minutes | ||
|
||
|
||
### Create a repository based on a template | ||
|
||
* Visit [https://github.com/teedoc/template](https://github.com/teedoc/template) or [https://github.com/teedoc/teedoc.github.io](https://github.com/teedoc/teedoc.github.io), click `Use this template` | ||
|
||
![github use template](./assets/github_use_template.jpg) | ||
|
||
|
||
* Set the name of the new repository to `username or organization name.github.io`, select the public repository, and then confirm the submission | ||
![create repo](assets/create_repo.jpg) | ||
|
||
> Then use `git clone your repository address` to clone to the local | ||
### Set up pages service | ||
|
||
* Wait for the automatic build to generate a new branch `gh-pages`, you can click on the `Actions` column to view the progress of the automatic build, if a green tick appears, it means it is OK, if a red cross appears, the build fails Yes, where is the problem, you can click in to view the log according to the screenshot method below (you must submit a screenshot of the log) and submit [issue](https://github.com/teedoc/teedoc.github.io/issues/ new) feedback | ||
|
||
![action status](./assets/action_status.jpg) | ||
|
||
If there is an error, you can click to view the error log according to the following figure: | ||
![error0](./assets/action_error.jpg) | ||
![error](.//assets/action_error_log.jpg) | ||
|
||
* Set the `pages` service of the repository and select the `gh-pages` branch. If there is no such branch, the previous step has not been completed or an error occurred. You can view the issue submission [issue](https://github.com/ teedoc/teedoc.github.io/issues/new) feedback | ||
![pages](./assets/pages_settings.jpg) | ||
|
||
* Then visit `username or organization name.github.io`, you will find a webpage, the content is exactly the same as `teedoc.github.io`! | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
teedoc 网站模板 | ||
===== | ||
|
||
**中文 README | [English README](./README.md)** | ||
|
||
此模板使用于 teedoc: [teedoc.neucrack.com](https://teedoc.neucrack.com/) 或 [teedoc.github.io](https://teedoc.github.io) learn more | ||
|
||
|
||
## 快速开始 | ||
|
||
* 安装 python3 | ||
|
||
`Windows` 或 `macOS`, 从 [python.org](https://www.python.org/downloads/) 下载安装包安装 | ||
|
||
`Linux`, 如 `Ubuntu`: | ||
|
||
``` | ||
sudo apt install python3 python3-pip | ||
``` | ||
|
||
* 安装 teedoc | ||
|
||
这条命令会 **安装 teedoc 主程序** | ||
|
||
``` | ||
pip3 install teedoc | ||
``` | ||
|
||
* 初始化文档 | ||
|
||
``` | ||
mkdir my_site | ||
cd my_site | ||
teedoc init | ||
``` | ||
|
||
或者 | ||
|
||
``` | ||
teedoc -d my_site init | ||
``` | ||
|
||
* 安装插件 | ||
|
||
这条命令会 **安装文档需要的插件**(在`site_config.json`里设置) | ||
|
||
``` | ||
cd my_site | ||
teedoc install | ||
``` | ||
|
||
* 构建(`build`) 或者 预览(`serve`) | ||
|
||
``` | ||
teedoc serve | ||
``` | ||
|
||
然后浏览器访问 [http://127.0.0.1:2333](http://127.0.0.1:2333) | ||
|
||
如果只需要构建生成网页: | ||
|
||
``` | ||
teedoc build | ||
``` | ||
|
||
|
||
|
||
## 几分钟内在 github pages 服务上创建你的网站 | ||
|
||
|
||
### 基于模板创建仓库 | ||
|
||
* 访问 [https://github.com/teedoc/template](https://github.com/teedoc/template) or [https://github.com/teedoc/teedoc.github.io](https://github.com/teedoc/teedoc.github.io), 点击 `Use this template` | ||
|
||
![github use template](./assets/github_use_template.jpg) | ||
|
||
|
||
* 设置新仓库的名字为`用户名或者组织名.github.io`, 选择公开仓库, 然后确认提交 | ||
![create repo](./assets/create_repo.jpg) | ||
|
||
> 之后使用`git clone 你的仓库地址`就可以克隆到本地了 | ||
### 设置 pages 服务 | ||
|
||
* 等待自动构建生成新的分支`gh-pages`, 可以点击 `Actions` 栏目查看自动构建的进度, 如果有绿色的勾勾出现了就代表可以了, 如果出现了红色的叉叉则是构建失败了, 哪里出了什么问题, 可以按照下面的截图方法点进去查看日志(提交问题必须要日志截图)并提交 [issue](https://github.com/teedoc/teedoc.github.io/issues/new) 反馈 | ||
|
||
![action status](./assets/action_status.jpg) | ||
|
||
如果有错误, 可以按照下图点进去查看错误日志: | ||
![error0](./assets/action_error.jpg) | ||
![error](./assets/action_error_log.jpg) | ||
|
||
* 设置仓库的 `pages` 服务, 选择`gh-pages`分支, 如果没有这个分支, 则是上一步还没进行完或者出错了,可以查看问题提交 [issue](https://github.com/teedoc/teedoc.github.io/issues/new) 反馈 | ||
![pages](./assets/pages_settings.jpg) | ||
|
||
* 然后访问 `用户名或者组织名.github.io`, 就会发现有网页啦, 内容和`teedoc.github.io`的一模一样! | ||
|
||
|
||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.