Skip to content

Commit

Permalink
Replace backticks with bold font in native/git
Browse files Browse the repository at this point in the history
  • Loading branch information
windsonsea committed Feb 26, 2024
1 parent d022e3d commit 3e503ba
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 45 deletions.
14 changes: 7 additions & 7 deletions docs/zh/docs/native/knowledge/git/2auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@

## 开启两步验证

1. 登录 GitHub,在右上角的头像旁,点击下拉箭头,选择 `Settings`
1. 登录 GitHub,在右上角的头像旁,点击下拉箭头,选择 __Settings__

![设置菜单](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/2auth01.png)

2. 选择 `Password and authentication` -> `Enable two-factor authentication`
2. 选择 __Password and authentication__ -> __Enable two-factor authentication__

![启用开关](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/2auth02.png)

3. 选择 sms 短信认证方式。

![sms 短信认证](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/2auth03.png)

4. 找了半天发现没有 China -_! 还好办法总比问题多。例如在 Chrome 中,右键点击当前页面,选择 `检查`-> `Console`,在光标处运行以下命令:
4. 找了半天发现没有 China -_! 还好办法总比问题多。例如在 Chrome 中,右键点击当前页面,选择 __检查__ -> __Console__ ,在光标处运行以下命令:

```bash
var option = new Option("China +86","+86");
option.selected = true;
document.getElementById('countrycode').options.add(option, 0);
```

5. 现在出现 +86 了,输入你的手机号,点击 `Send authentication code`,输入手机短信的六位码进行验证,屏幕将显示 16 个 recovery code。
5. 现在出现 +86 了,输入你的手机号,点击 __Send authentication code__ ,输入手机短信的六位码进行验证,屏幕将显示 16 个 recovery code。

![recovery code](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/2auth04.png)

> 这个 recovery code 最好打印下来,电子版也要 download 存放好。

6. 点击 `I have saved my recovery codes`。恭喜你,屏幕出现了天女散花,两步验证设置成功了。
6. 点击 __I have saved my recovery codes__ 。恭喜你,屏幕出现了天女散花,两步验证设置成功了。

## 设置 ssh-keygen 或 access token

Expand Down Expand Up @@ -70,7 +70,7 @@

![获取 ssh key](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/ssh4.png)

5. 登录 GitHub,依次点击 `Settings` -> `SSH and GPG keys` -> `New SSH key`,随意给个 Title,在 Key 文本框中输入上一步获取的公钥后保存。
5. 登录 GitHub,依次点击 __Settings__ -> __SSH and GPG keys__ -> __New SSH key__ ,随意给个 Title,在 Key 文本框中输入上一步获取的公钥后保存。

![获取 ssh key](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/ssh5.png)

Expand All @@ -87,4 +87,4 @@
```

3. 运行 git clone xxx 命令,提示输入 UserName 和 Token。
这样就会在用户根目录生成一个名为 `.git-credentials` 的文件,里面保存了你的 UserName 和 Token。
这样就会在用户根目录生成一个名为 __.git-credentials__ 的文件,里面保存了你的 UserName 和 Token。
10 changes: 5 additions & 5 deletions docs/zh/docs/native/knowledge/git/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ GitHub 号称有一亿开发者活跃,如何能在目标社区展露头角?

看到一个 PR 或 Issue 时,如果心中有所疑问,或看出了什么问题,要积极留下 comments。

1. 点击每一行左侧的 `+`
1. 点击每一行左侧的 __+__

![comments](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/comments1.png)

2. 点击 `Add a suggestion` 图标,修改代码后,点击 `Start a review`
2. 点击 __Add a suggestion__ 图标,修改代码后,点击 __Start a review__

![comments](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/comments2.png)

!!! warning

尽量不要点击 `Add single comment`,除非你真的只有一条 comment。
尽量不要点击 __Add single comment__ ,除非你真的只有一条 comment。
这是因为你每一条 comment,都会给这个 PR 的作者、Reviwer、关注者群发一封邮件!
如果你连续点击 `Add single comment`,将对这些人的邮箱形成轰炸效果,Spam!!!
如果你连续点击 __Add single comment__ ,将对这些人的邮箱形成轰炸效果,Spam!!!

3. 看完全文,做了所有 comment 之后,点击右上角 `Finish your review`,勾选 `Comment` 后点击 `Submit review`
3. 看完全文,做了所有 comment 之后,点击右上角 __Finish your review__ ,勾选 __Comment__ 后点击 __Submit review__

![comments](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/comments3.png)

Expand Down
26 changes: 13 additions & 13 deletions docs/zh/docs/native/knowledge/git/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@

!!! tip

K8s 和 Istio 网站都有类似的按钮,比如 `Edit this page`、`Edit this page on GitHub`
K8s 和 Istio 网站都有类似的按钮,比如 __Edit this page__ 、 __Edit this page on GitHub__

![点击图标按钮](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/local01.png)

1. 完成编辑操作后,点击右上角的 `Commit changes` 按钮。
1. 完成编辑操作后,点击右上角的 __Commit changes__ 按钮。

![commit change](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/local02.png)

1. 修改 `Commit message`,填写 `Extended description` 后,点击 `Propose changes` 按钮。
1. 修改 __Commit message__ ,填写 __Extended description__ 后,点击 __Propose changes__ 按钮。

![propose change](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/local03.png)

1. 点击 `Create pull request` 按钮就完成了提交 PR 的操作。
1. 点击 __Create pull request__ 按钮就完成了提交 PR 的操作。

![create PR](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/local04.png)

1. 提交 PR 后,Reviewer 会给出一些 comments,你也可以在网页上修改。

点击 `Files changed` 页签,点击右侧的 `...`,选择 `Edit file`,就能开始编辑修改文件了。
点击 __Files changed__ 页签,点击右侧的 __...__ ,选择 __Edit file__ ,就能开始编辑修改文件了。

![Edit file](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/local05.png)

Expand All @@ -51,7 +51,7 @@
如果你修改的文件不止 1 个,那可以试试 Codespace。Codespace 是一个云端的 VSCode 环境。
这种云端的 VSCode 好处是随时随地,缺点是免费版本只能保留几小时的环境,只有 VIP 才能长期留存数据。

1. 进入你的 Fork,点击 `Code` -> `Codespaces` -> `Create Codespace on main`
1. 进入你的 Fork,点击 __Code__ -> __Codespaces__ -> __Create Codespace on main__

![Create Codespace](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/cloud01.png)

Expand Down Expand Up @@ -92,13 +92,13 @@
git checkout -b yourbranch
```

1. 在本地完成编辑工作后,推荐在本地运行 `mkdocs serve` 进行预览,以免把错误带到线上。
1. 在本地完成编辑工作后,推荐在本地运行 __mkdocs serve__ 进行预览,以免把错误带到线上。

![本地预览](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/make-serve.png)

!!! tip

- 每天开始前,切到 main 分支,运行 `git pull` 更新本地数据,与服务器的文件保持同步,以免跟别人的修改发生冲突。
- 每天开始前,切到 main 分支,运行 __git pull__ 更新本地数据,与服务器的文件保持同步,以免跟别人的修改发生冲突。
- 每天结束前,要将当天的修改提交上去。Git 是一种小步快走的开发模式,只需保证每一步正确,那天长日久将成就伟业。

1. 本地预览正常后,依次运行以下命令提交修改的内容。
Expand Down Expand Up @@ -126,16 +126,16 @@

![请求 review](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/review1.png)

1. 点击 `Files changed` 查看改了什么内容。
1. 点击 __Files changed__ 查看改了什么内容。

![review 列表](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/review2.png)

1. 如果对某句话有不同想法,可以直接添加 comment。

![添加注释](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/review3.png)

- 建议点击 `Add a suggestion` 图标后进行修改,这样 PR 作者可以清晰看到评审建议。
- 写好 comment 后,点击 `Start a review` 按钮,继续看其他字句,全部看完以后统一 `Submit review`
- 建议点击 __Add a suggestion__ 图标后进行修改,这样 PR 作者可以清晰看到评审建议。
- 写好 comment 后,点击 __Start a review__ 按钮,继续看其他字句,全部看完以后统一 __Submit review__

1. PR 作者收到 comment 后,要及时去修复,最后运行以下命令覆盖原来的提交。

Expand Down Expand Up @@ -166,7 +166,7 @@ make lint-yaml

对于前端 UI 文字翻译,除了 Weblate 翻译外,还可以用 i18n 插件。以 VScode 为例:

1. 安装 `i18n Ally` 插件。
1. 安装 __i18n Ally__ 插件。

![安装插件](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/i18n01.png)

Expand All @@ -176,7 +176,7 @@ make lint-yaml
npm i
```

1. 点击左侧的 `i18n Ally` 页签,找到 `No Translation` 内容,点击 `Open in editor` 图标。
1. 点击左侧的 __i18n Ally__ 页签,找到 __No Translation__ 内容,点击 __Open in editor__ 图标。

![开始翻译](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/i18n02.png)

Expand Down
6 changes: 3 additions & 3 deletions docs/zh/docs/native/knowledge/git/lsync.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

在仓库的根目录中,

1. 赋予 lsync.sh 脚本可执行权限(主要是解决 `permission denied` 问题)
1. 赋予 lsync.sh 脚本可执行权限(主要是解决 __permission denied__ 问题)

```sh
sudo chmod +x ./scripts/lsync.sh
Expand Down Expand Up @@ -56,10 +56,10 @@

!!! tip

上述命令建议在 `main` 分支中运行。
上述命令建议在 __main__ 分支中运行。

## Windows

可以在 [Git for Windows](https://gitforwindows.org/) 中直接运行上述 diff 命令,无需 `sudo chmod` 赋权操作。
可以在 [Git for Windows](https://gitforwindows.org/) 中直接运行上述 diff 命令,无需 __sudo chmod__ 赋权操作。

![windows](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/windows.jpg)
14 changes: 7 additions & 7 deletions docs/zh/docs/native/knowledge/git/proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

代理俗称梯子、科学上网、翻墙等等,这是使用 GitHub 的第一步。

对于 GitHub,有时候虽然开启了代理,但 `git clone` 的速度还是超级慢,每秒只有几 K 几十 K,还经常 push timeout,这不能忍!
对于 GitHub,有时候虽然开启了代理,但 __git clone__ 的速度还是超级慢,每秒只有几 K 几十 K,还经常 push timeout,这不能忍!

## Win10

显示隐藏文件,修改系统盘的用户根目录的 `.gitconfig` 文件。
显示隐藏文件,修改系统盘的用户根目录的 __.gitconfig__ 文件。

1. 查找你的 http 代理地址和端口号。

![http 地址和端口](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/proxy1.png)

2. 在系统盘的用户根目录找到 `.gitconfig` 文件,比如我的电脑是:
2. 在系统盘的用户根目录找到 __.gitconfig__ 文件,比如我的电脑是:

```path
C:\Users\michael\.gitconfig
```
3. 编辑 `.gitconfig` 文件,在底部增加这两行:
3. 编辑 __.gitconfig__ 文件,在底部增加这两行:
```bash
[http]
Expand All @@ -27,7 +27,7 @@
proxy = https://127.0.0.1:10809
```
4. 保存退出,去重新运行 `git clone` 命令,速度提高了 100 倍,哈哈。我的 .gitconfig 示例配置如下:
4. 保存退出,去重新运行 __git clone__ 命令,速度提高了 100 倍,哈哈。我的 .gitconfig 示例配置如下:
```git
[user]
Expand All @@ -48,7 +48,7 @@
## Mac
显示隐藏文件,修改当前用户根目录下的 `.gitconfig` 文件。
显示隐藏文件,修改当前用户根目录下的 __.gitconfig__ 文件。
1. 在终端中运行以下命令,显示隐藏文件:
Expand All @@ -60,7 +60,7 @@
![mac 梯子](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/mac-proxy.png)
3. 在用户根目录,找到 `.gitconfig` 文件,用 VScode 等编辑器进行修改。
3. 在用户根目录,找到 __.gitconfig__ 文件,用 VScode 等编辑器进行修改。
```git
[user]
Expand Down
10 changes: 5 additions & 5 deletions docs/zh/docs/native/knowledge/git/rebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ git commit --amend --no-edit

> 因为类似 kpanda 提倡 1 个 commit 对应 1 个 PR,这条命令将把修改追加到上一个 commit。
然后运行 `git push origin docsite -f` 强制推送到远程仓库。
然后运行 __git push origin docsite -f__ 强制推送到远程仓库。

### 方案 2

Expand Down Expand Up @@ -72,15 +72,15 @@ git rebase 之后把不相干的 commit 全部注释掉。
git log
```

查看完后,按字母 `q` 退出。
查看完后,按字母 __q__ 退出。

2. 发起变基。

```bash
git rebase -i HEAD~3
```

`HEAD~3` 表示从头部开始追溯 3 条记录
__HEAD~3__ 表示从头部开始追溯 3 条记录

3. 开始编辑文件。

Expand All @@ -106,7 +106,7 @@ git rebase 之后把不相干的 commit 全部注释掉。

## OpenSSL SSL_read 错误

如果运行 `git push origin xxx` 后提示以下错误:
如果运行 __git push origin xxx__ 后提示以下错误:

```text
fatal: unable to access 'https://github.com/windsonsea/website-1.git/': OpenSSL SSL_read: Connection was reset, errno 10054
Expand All @@ -120,7 +120,7 @@ git config --global http.sslVerify "false"

> 如果还提示这个错误,可以切换一个 VPN 的入口。

然后重新运行 `git push origin xxx`,必要时可增加 `-f` 标记来强制推送。
然后重新运行 __git push origin xxx__ ,必要时可增加 __-f__ 标记来强制推送。

## port 443 超时问题

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/docs/native/knowledge/git/ui-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

前端 UI 翻译之后,可以参照以下步骤在本地预览实时效果。例如调整单词长度、大小写、查看一致性等。

1. 进入 repo 根目录,创建 `.env.local` 本地环境文件。
1. 进入 repo 根目录,创建 __.env.local__ 本地环境文件。

```shell
touch .env.local
Expand Down
8 changes: 4 additions & 4 deletions docs/zh/docs/native/knowledge/git/vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

## 编辑 Repo

git clone 某个 repo 后,建议通过 **File** -> **Open Folder...** 进入 repo 工作空间。
`git clone` 某个 repo 后,建议通过 **File** -> **Open Folder...** 进入 repo 工作空间。
随后就能在底部终端的 repo 根目录下运行各种 git 命令了。

![workspace](https://docs.daocloud.io/daocloud-docs-images/docs/zh/docs/native/knowledge/images/vscode02.png)
Expand All @@ -32,16 +32,16 @@ git clone 某个 repo 后,建议通过 **File** -> **Open Folder...** 进入 r

查找所有图片:

```
```text
!\[.*?\]\((?:https?:\/\/)?\S+\.(?:png|jpg|jpeg|gif|bmp)\)
```

查找所有前后带 /` 的字符,并替换为粗体:

```
```text
`([^`].*?)`
```
```
```text
**$1**
```

Expand Down

0 comments on commit 3e503ba

Please sign in to comment.