提交 84472532 编写于 作者: sinat_25235033's avatar sinat_25235033

add more cn introduce

上级 0124d0d8
- 开始
- [介绍](sureness.md "The greatest")
\ No newline at end of file
- 入门
- [介绍](sureness.md "introduce")
- [快速开始](quickstart.md "quick start greatest")
- 进阶扩展
- [扩展点]()
- [自定义数据源]()
- [自定义subject]()
- [自定义processor]()
- 集成案例
- [10分钟项目集成](sample-bootstrap.md)
- [30分钟项目集成](sample-tom.md)
- 其它
- [参与贡献](contributing.md)
- [change]()
- [我们的愿景]()
Contributing to sureness
=======================================
Summary
-------
This document covers how to contribute to the sureness project. These instructions assume you have a GitHub.com account, so if you don't have one you will have to create one. Your proposed code changes will be published to your own fork of the sureness project and you will submit a Pull Request for your changes to be added.
_Lets get started!!!_
Fork the code
-------------
In your browser, navigate to: [https://github.com/tomsun28/sureness](https://github.com/tomsun28/sureness)
Fork the repository by clicking on the 'Fork' button on the top right hand side. The fork will happen and you will be taken to your own fork of the repository. Copy the Git repository URL by clicking on the clipboard next to the URL on the right hand side of the page under '**HTTPS** clone URL'. You will paste this URL when doing the following `git clone` command.
On your computer, follow these steps to setup a local repository for working on sureness:
``` bash
$ git clone https://github.com/YOUR_ACCOUNT/sureness.git
$ cd sureness
$ git remote add upstream https://github.com/tomsun28/sureness.git
$ git checkout master
$ git fetch upstream
$ git rebase upstream/master
```
Making changes
--------------
It is important that you create a new branch to make changes on and that you do not change the `master` branch (other than to rebase in changes from `upstream/master`). In this example I will assume you will be making your changes to a branch called `feature_x`. This `feature_x` branch will be created on your local repository and will be pushed to your forked repository on GitHub. Once this branch is on your fork you will create a Pull Request for the changes to be added to the sureness project.
It is best practice to create a new branch each time you want to contribute to the project and only track the changes for that pull request in this branch.
``` bash
$ git checkout -b feature_x
(make your changes)
$ git status
$ git add .
$ git commit -a -m "descriptive commit message for your changes"
```
> The `-b` specifies that you want to create a new branch called `feature_x`. You only specify `-b` the first time you checkout because you are creating a new branch. Once the `feature_x` branch exists, you can later switch to it with only `git checkout feature_x`.
Rebase `feature_x` to include updates from `upstream/master`
------------------------------------------------------------
It is important that you maintain an up-to-date `master` branch in your local repository. This is done by rebasing in the code changes from `upstream/master` into your local repository. You will want to do this before you start working on a feature as well as right before you submit your changes as a pull request. I recommend you do this process periodically while you work to make sure you are working off the most recent project code.
This process will do the following:
1. Checkout your local `master` branch
2. Synchronize your local `master` branch with the `upstream/master` so you have all the latest changes from the project
3. Rebase the latest project code into your `feature_x` branch so it is up-to-date with the upstream code
``` bash
$ git checkout master
$ git fetch upstream
$ git rebase upstream/master
$ git checkout feature_x
$ git rebase master
```
> Now your `feature_x` branch is up-to-date with all the code in `upstream/master`.
Make a GitHub Pull Request to contribute your changes
-----------------------------------------------------
When you are happy with your changes and you are ready to contribute them, you will create a Pull Request on GitHub to do so. This is done by pushing your local changes to your forked repository (default remote name is `origin`) and then initiating a pull request on GitHub.
> **IMPORTANT:** Make sure you have rebased your `feature_x` branch to include the latest code from `upstream/master` _before_ you do this.
``` bash
$ git push origin master
$ git push origin feature_x
```
Now that the `feature_x` branch has been pushed to your GitHub repository, you can initiate the pull request.
To initiate the pull request, do the following:
1. In your browser, navigate to your forked repository: [https://github.com/YOUR_ACCOUNT/sureness](https://github.com/tomsun28/sureness)
2. Click the new button called '**Compare & pull request**' that showed up just above the main area in your forked repository
3. Validate the pull request will be into the upstream `master` and will be from your `feature_x` branch
4. Enter a detailed description of the work you have done and then click '**Send pull request**'
If you are requested to make modifications to your proposed changes, make the changes locally on your `feature_x` branch, re-push the `feature_x` branch to your fork. The existing pull request should automatically pick up the change and update accordingly.
Cleaning up after a successful pull request
-------------------------------------------
Once the `feature_x` branch has been committed into the `upstream/master` branch, your local `feature_x` branch and the `origin/feature_x` branch are no longer needed. If you want to make additional changes, restart the process with a new branch.
> **IMPORTANT:** Make sure that your changes are in `upstream/master` before you delete your `feature_x` and `origin/feature_x` branches!
You can delete these deprecated branches with the following:
``` bash
$ git checkout master
$ git branch -D feature_x
$ git push origin :feature_x
```
# 快速开始
推荐全局安装 `docsify-cli` 工具,可以方便地创建及在本地预览生成的文档。
```bash
npm i docsify-cli -g
```
## 初始化项目
如果想在项目的 `./docs` 目录里写文档,直接通过 `init` 初始化项目。
```bash
docsify init ./docs
```
## 开始写文档
初始化成功后,可以看到 `./docs` 目录下创建的几个文件
- `index.html` 入口文件
- `README.md` 会做为主页内容渲染
- `.nojekyll` 用于阻止 GitHub Pages 忽略掉下划线开头的文件
直接编辑 `docs/README.md` 就能更新文档内容,当然也可以[添加更多页面](zh-cn/more-pages.md)
## 本地预览
通过运行 `docsify serve` 启动一个本地服务器,可以方便地实时预览效果。默认访问地址 http://localhost:3000 。
```bash
docsify serve docs
```
?> 更多命令行工具用法,参考 [docsify-cli 文档](https://github.com/docsifyjs/docsify-cli)
## 手动初始化
如果不喜欢 npm 或者觉得安装工具太麻烦,我们可以直接手动创建一个 `index.html` 文件。
*index.html*
```html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/vue.css">
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
//...
}
</script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
</body>
</html>
```
如果你的系统里安装了 Python 的话,也可以很容易地启动一个静态服务器去预览你的网站。
```bash
cd docs && python -m SimpleHTTPServer 3000
```
## Loading 提示
初始化时会显示 `Loading...` 内容,你可以自定义提示信息。
```html
<!-- index.html -->
<div id="app">加载中</div>
```
如果更改了 `el` 的配置,需要将该元素加上 `data-app` 属性。
```html
<!-- index.html -->
<div data-app id="main">加载中</div>
<script>
window.$docsify = {
el: '#main'
}
</script>
```
对比 [el 设置](configuration.md#el)
## sample-bootstrap
sureness 10分钟例子项目
- 基于`springboot`
- 从默认的配置文件`sureness.yml`加载账户信息,资源角色,过滤资源等信息
- 使用默认的`sureness-config`
- 使用默认的`jwt,basic auth`方式认证鉴权
- 例子中包含`restful api,websocket`
- 保护入口: `SurenessFilterExample`
- 推荐使用`postman`测试,测试样例为`sample-bootstrap-postman.json`,导入`postman`即可
## sample-tom
sureness 30分钟例子项目
- 基于`springboot,jpa...`[数据源sql](src/main/resources/db)
- 自定义数据源,使用从数据库加载账户信息,资源角色,过滤资源等信息,这样便于动态调整
- 除了使用了默认的`jwt,basic auth`方式认证鉴权,新增自定义认证鉴权(自定义`subject subjectCreator processor...`)
- 推荐使用`postman`测试,测试样例为`sample-tom-postman.json`,导入`postman`即可
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册