Skip to content

Commit

Permalink
refactor: use md in links (#105)
Browse files Browse the repository at this point in the history
* refactor: use md in links

In this way, the links are not only available on the Hugo site,
but also available on GitHub, at local, etc.

* docs(CONTRIBUTING): add internal links rule

* refactor(setup): update links

* refactor(tips, faq): update links

* refactor(actions, code-edit): update links

* refactor(extensions, file-path, language): update links

* rename directories to the names in the URLs

* style: Format Markdown files (#112)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update CONTRIBUTING.md

Co-authored-by: Shuhao Zhang <studyingfather@outlook.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 6, 2020
1 parent daac74f commit c9245d5
Show file tree
Hide file tree
Showing 59 changed files with 90 additions and 83 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -67,6 +67,12 @@ There are some attributes in the frontmatter of each Markdown file:
- `weight`: The weight of this page used when sorting pages. The page with the bigger weight is after the page with the smaller weight.
- `description`: The description of this page, displayed in the list of pages and the top of this page.

## Internal links

In Markdown files, please use `[<title>](<relative path to the file>#<fragment>)` to make internal links.

For example: `[Preferences->Languages->C++->C++ Commands](../preferences/language/_index.md#c-commands)`.

## Markdown Formatting

We use [remark-lint](https://github.com/remarkjs/remark-lint) to format Markdown files.
Expand Down
2 changes: 1 addition & 1 deletion content/docs/FAQ/_index.md → content/docs/faq/_index.md
Expand Up @@ -14,4 +14,4 @@ description: Frequently asked questions by CP Editor users
- When I click the Submit button, I get some message saying template is required?
- `cf` tool requires you to configure it before you use it. Please run `cf config` to set the username & password and add a template.
- How to enable error linting in the code editor?
- You need to install a [Language Server program](https://microsoft.github.io/language-server-protocol/implementors/servers/) and set the settings in Preferences -> Extensions -> Language Server. You can learn about more details [here](../setup#setup-language-server).
- You need to install a [Language Server program](https://microsoft.github.io/language-server-protocol/implementors/servers/) and set the settings in Preferences -> Extensions -> Language Server. You can learn about more details [here](../setup/_index.md#setup-language-server).
Expand Up @@ -14,4 +14,4 @@ description: Frequently asked questions by CP Editor users
- When I click the Submit button, I get some message saying template is required?
- `cf` tool requires you to configure it before you use it. Please run `cf config` to set the username & password and add a template.
- How to enable error linting in the code editor?
- You need to install a [Language Server program](https://microsoft.github.io/language-server-protocol/implementors/servers/) and set the settings in Preferences -> Extensions -> Language Server. You can learn about more details [here](../setup#setup-language-server).
- You need to install a [Language Server program](https://microsoft.github.io/language-server-protocol/implementors/servers/) and set the settings in Preferences -> Extensions -> Language Server. You can learn about more details [here](../setup/_index.ru.md#setup-language-server).
Expand Up @@ -14,4 +14,4 @@ description: Frequently asked questions by CP Editor users
- When I click the Submit button, I get some message saying template is required?
- `cf` tool requires you to configure it before you use it. Please run `cf config` to set the username & password and add a template.
- How to enable error linting in the code editor?
- You need to install a [Language Server program](https://microsoft.github.io/language-server-protocol/implementors/servers/) and set the settings in Preferences -> Extensions -> Language Server. You can learn about more details [here](../setup#setup-language-server).
- You need to install a [Language Server program](https://microsoft.github.io/language-server-protocol/implementors/servers/) and set the settings in Preferences -> Extensions -> Language Server. You can learn about more details [here](../setup/_index.zh.md#setup-language-server).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -23,7 +23,7 @@ Save your code when executing it.

Save the test cases on the disk when saving the code.

You can choose where to save the test cases in [File Path/Testcases](../file-path#testcases).
You can choose where to save the test cases in [File Path/Testcases](../file-path/_index.md#testcases).

## Auto Save

Expand Down
Expand Up @@ -23,7 +23,7 @@ Save your code when executing it.

Save the test cases on the disk when saving the code.

You can choose where to save the test cases in [File Path/Testcases](../file-path#testcases).
You can choose where to save the test cases in [File Path/Testcases](../file-path/_index.ru.md#testcases).

## Auto Save

Expand Down
Expand Up @@ -23,7 +23,7 @@ Save your code when executing it.

Save the test cases on the disk when saving the code.

You can choose where to save the test cases in [File Path/Testcases](../file-path#testcases).
You can choose where to save the test cases in [File Path/Testcases](../file-path/_index.zh.md#testcases).

## Auto Save

Expand Down
File renamed without changes.
Expand Up @@ -22,19 +22,19 @@ Automatically add the right parenthesis when you type the left one. For example,

When the character next to the cursor is a right parenthesis and you type this parenthesis, instead of typing this parenthesis, the cursor will jump out of the parenthesis.

You can choose the parentheses to auto-complete in the [Parentheses](../language#parentheses) settings.
You can choose the parentheses to auto-complete in the [Parentheses](../language/_index.md#parentheses) settings.

### Auto Remove Parentheses

When you delete a left parenthesis, if a corresponding right parenthesis is next to it, the right parenthesis will also be deleted.

You can choose the parentheses to auto-remove in the [Parentheses](../language#parentheses) settings.
You can choose the parentheses to auto-remove in the [Parentheses](../language/_index.md#parentheses) settings.

### Jump out of a parenthesis by pressing Tab

When the cursor is next to a right parenthesis, you can use the Tab key to jump out of it. If [Auto Complete Parentheses](#auto-complete-parentheses) is enabled, this is an alternative of typing the right parenthesis.

You can choose the parentheses to jump out by Tab in the [Parentheses](../language#parentheses) settings.
You can choose the parentheses to jump out by Tab in the [Parentheses](../language/_index.md#parentheses) settings.

### Replace tabs by spaces

Expand Down
Expand Up @@ -22,19 +22,19 @@ Automatically add the right parenthesis when you type the left one. For example,

When the character next to the cursor is a right parenthesis and you type this parenthesis, instead of typing this parenthesis, the cursor will jump out of the parenthesis.

You can choose the parentheses to auto-complete in the [Parentheses](../language#parentheses) settings.
You can choose the parentheses to auto-complete in the [Parentheses](../language/_index.ru.md#parentheses) settings.

### Auto Remove Parentheses

When you delete a left parenthesis, if a corresponding right parenthesis is next to it, the right parenthesis will also be deleted.

You can choose the parentheses to auto-remove in the [Parentheses](../language#parentheses) settings.
You can choose the parentheses to auto-remove in the [Parentheses](../language/_index.ru.md#parentheses) settings.

### Jump out of a parenthesis by pressing Tab

When the cursor is next to a right parenthesis, you can use the Tab key to jump out of it. If [Auto Complete Parentheses](#auto-complete-parentheses) is enabled, this is an alternative of typing the right parenthesis.

You can choose the parentheses to jump out by Tab in the [Parentheses](../language#parentheses) settings.
You can choose the parentheses to jump out by Tab in the [Parentheses](../language/_index.ru.md#parentheses) settings.

### Replace tabs by spaces

Expand Down
Expand Up @@ -22,19 +22,19 @@ weight: 10

如果光标处右边的第一个字符是右括号,而你输入了一个右括号,光标将会自动跳到该右括号后面,而不再输入右括号。

你可以在各语言的 [括号](../language#括号) 设置中设置各语言自动补全的括号类型。
你可以在各语言的 [括号](../language/_index.zh.md#括号) 设置中设置各语言自动补全的括号类型。

### 自动删除括号

在删除一个左括号时,如果其右侧有一个右括号相邻,则该右括号也会被自动删除。

你可以在各语言的 [括号](../language#括号) 设置中设置各语言自动删除的括号类型。
你可以在各语言的 [括号](../language/_index.zh.md#括号) 设置中设置各语言自动删除的括号类型。

### 在按下 Tab 键时跳出括号

如果光标处右边的第一个字符时右括号,你可以通过按下 Tab 键来自动跳出这对括号。如果 [自动补全括号](#自动补全括号) 选项被启用,这种方式可以作为输入右括号的另一种方式。

你可以在各语言的 [括号](../language#括号) 设置中设置各语言按下 Tab 时自动跳出的括号类型。
你可以在各语言的 [括号](../language/_index.zh.md#括号) 设置中设置各语言按下 Tab 时自动跳出的括号类型。

### 将制表符替换为空格

Expand Down
Expand Up @@ -9,7 +9,7 @@ weight: 50

Clang Format is used to format the C/C++ and Java codes. You can click Actions->Format Code or press the shortcut <kbd>Ctrl+Shift+I</kbd> to format the codes. If you have selected a part of the code, only the selection (and its necessary adjacent codes) will be formatted.

**See also** [Setup Clang Format](../../setup#clang-format).
**See also** [Setup Clang Format](../../setup/_index.md#setup-clang-format).

#### Program

Expand All @@ -29,7 +29,7 @@ You can read [Clang-Format Style Options documentation](https://clang.llvm.org/d

YAPF is used to format the Python codes. You can click Actions->Format Code or press the shortcut <kbd>Ctrl+Shift+I</kbd> to format the codes. If you have selected a part of the code, only these lines will be formatted.

**See also** [Setup YAPF](../../setup#yapf).
**See also** [Setup YAPF](../../setup/_index.md#yapf).

#### Program

Expand All @@ -50,7 +50,7 @@ The YAPF Format style. The content here is the same as the content of a `.style.

## Language Server

**See also** [Setup Language Server](../../setup#setup-language-server).
**See also** [Setup Language Server](../../setup/_index.md#setup-language-server).

### Use Linting with Language Server

Expand All @@ -74,7 +74,7 @@ For example, if you are using `pyls` for Python, you probably want to use `pytho

## Competitive Companion

**See also** [Setup Competitive Companion](../../setup#setup-competitive-companion).
**See also** [Setup Competitive Companion](../../setup/_index.md#setup-competitive-companion).

### Open New Tabs

Expand Down Expand Up @@ -114,7 +114,7 @@ You can use [CF Tool](https://github.com/xalanq/cf-tool/) to submit your solutio

To submit a solution, you have to either parse a problem by [Competitive Companion](#competitive-companion) from Codeforces, or manually set the problem URL of a tab in the context menu of it.

**See also** [Setup CF Tool](../../setup#setup-cf-tool).
**See also** [Setup CF Tool](../../setup/_index.md#setup-cf-tool).

### Path

Expand Down
Expand Up @@ -9,7 +9,7 @@ weight: 50

Clang Format is used to format the C/C++ and Java codes. You can click Actions->Format Code or press the shortcut <kbd>Ctrl+Shift+I</kbd> to format the codes. If you have selected a part of the code, only the selection (and its necessary adjacent codes) will be formatted.

**See also** [Setup Clang Format](../../setup#clang-format).
**See also** [Setup Clang Format](../../setup/_index.ru.md#setup-clang-format).

#### Program

Expand All @@ -29,7 +29,7 @@ You can read [Clang-Format Style Options documentation](https://clang.llvm.org/d

YAPF is used to format the Python codes. You can click Actions->Format Code or press the shortcut <kbd>Ctrl+Shift+I</kbd> to format the codes. If you have selected a part of the code, only these lines will be formatted.

**See also** [Setup YAPF](../../setup#yapf).
**See also** [Setup YAPF](../../setup/_index.ru.md#yapf).

#### Program

Expand All @@ -50,7 +50,7 @@ The YAPF Format style. The content here is the same as the content of a `.style.

## Language Server

**See also** [Setup Language Server](../../setup#setup-language-server).
**See also** [Setup Language Server](../../setup/_index.ru.md#setup-language-server).

### Use Linting with Language Server

Expand All @@ -74,7 +74,7 @@ For example, if you are using `pyls` for Python, you probably want to use `pytho

## Competitive Companion

**See also** [Setup Competitive Companion](../../setup#setup-competitive-companion).
**See also** [Setup Competitive Companion](../../setup/_index.ru.md#setup-competitive-companion).

### Open New Tabs

Expand Down Expand Up @@ -114,7 +114,7 @@ You can use [CF Tool](https://github.com/xalanq/cf-tool/) to submit your solutio

To submit a solution, you have to either parse a problem by [Competitive Companion](#competitive-companion) from Codeforces, or manually set the problem URL of a tab in the context menu of it.

**See also** [Setup CF Tool](../../setup#setup-cf-tool).
**See also** [Setup CF Tool](../../setup/_index.ru.md#setup-cf-tool).

### Path

Expand Down
Expand Up @@ -9,7 +9,7 @@ weight: 50

Clang Format is used to format the C/C++ and Java codes. You can click Actions->Format Code or press the shortcut <kbd>Ctrl+Shift+I</kbd> to format the codes. If you have selected a part of the code, only the selection (and its necessary adjacent codes) will be formatted.

**See also** [Setup Clang Format](../../setup#clang-format).
**See also** [Setup Clang Format](../../setup/_index.zh.md#setup-clang-format).

#### Program

Expand All @@ -29,7 +29,7 @@ You can read [Clang-Format Style Options documentation](https://clang.llvm.org/d

YAPF is used to format the Python codes. You can click Actions->Format Code or press the shortcut <kbd>Ctrl+Shift+I</kbd> to format the codes. If you have selected a part of the code, only these lines will be formatted.

**See also** [Setup YAPF](../../setup#yapf).
**See also** [Setup YAPF](../../setup/_index.zh.md#yapf).

#### Program

Expand All @@ -50,7 +50,7 @@ The YAPF Format style. The content here is the same as the content of a `.style.

## Language Server

**See also** [Setup Language Server](../../setup#setup-language-server).
**See also** [Setup Language Server](../../setup/_index.zh.md#setup-language-server).

### Use Linting with Language Server

Expand All @@ -74,7 +74,7 @@ For example, if you are using `pyls` for Python, you probably want to use `pytho

## Competitive Companion

**See also** [Setup Competitive Companion](../../setup#setup-competitive-companion).
**See also** [Setup Competitive Companion](../../setup/_index.zh.md#setup-competitive-companion).

### Open New Tabs

Expand Down Expand Up @@ -114,7 +114,7 @@ You can use [CF Tool](https://github.com/xalanq/cf-tool/) to submit your solutio

To submit a solution, you have to either parse a problem by [Competitive Companion](#competitive-companion) from Codeforces, or manually set the problem URL of a tab in the context menu of it.

**See also** [Setup CF Tool](../../setup#setup-cf-tool).
**See also** [Setup CF Tool](../../setup/_index.zh.md#setup-cf-tool).

### Path

Expand Down
Expand Up @@ -7,7 +7,7 @@ weight: 60

### Input File Save Path & Answer File Save Path

The path where the test cases are [saved](../actions#save-testcases-on-save). If it is a relative path, it is relative to the source file.
The path where the test cases are [saved](../actions/_index.md#save-testcases-on-save). If it is a relative path, it is relative to the source file.

You can use the following place holders:

Expand All @@ -29,7 +29,7 @@ If the path is `testcases/${basename}-${1-index}.in`, the input of this test cas

The rules used to match test cases when loading pairs of test cases.

Each rule is a pair of [regular expression patterns](../general#regular-expression). The first regex matches the whole input file name, and the second pattern is a replacement pattern which is the name of the answer file.
Each rule is a pair of [regular expression patterns](../general/_index.md#regular-expression). The first regex matches the whole input file name, and the second pattern is a replacement pattern which is the name of the answer file.

For example, you can use `(.+)\.in` and `\1.out` to match `test-1.in` and `test-1.out`, or use `(.+)\.in\.(\d+)` and `\1.ans.\2` to match `test.in.3` and `test.ans.3`.

Expand All @@ -41,7 +41,7 @@ When loading pairs of test cases, each rule which matches an input file will be

The default path when choosing where to save an untitled tab with problem URL.

Each rule is a pair of [regular expression patterns](../general#regular-expression). The first regex matches a part of the problem URL, and the second pattern is a replacement pattern which is the default save path.
Each rule is a pair of [regular expression patterns](../general/_index.md#regular-expression). The first regex matches a part of the problem URL, and the second pattern is a replacement pattern which is the default save path.

When saving a file with problem URL, if the problem URL matches at least one regex in the rules, the default save path will be the replacement of the first matching regex.

Expand Down
Expand Up @@ -7,7 +7,7 @@ weight: 60

### Input File Save Path & Answer File Save Path

The path where the test cases are [saved](../actions#save-testcases-on-save). If it is a relative path, it is relative to the source file.
The path where the test cases are [saved](../actions/_index.ru.md#save-testcases-on-save). If it is a relative path, it is relative to the source file.

You can use the following place holders:

Expand All @@ -29,7 +29,7 @@ If the path is `testcases/${basename}-${1-index}.in`, the input of this test cas

The rules used to match test cases when loading pairs of test cases.

Each rule is a pair of [regular expression patterns](../general#regular-expression). The first regex matches the whole input file name, and the second pattern is a replacement pattern which is the name of the answer file.
Each rule is a pair of [regular expression patterns](../general/_index.ru.md#regular-expression). The first regex matches the whole input file name, and the second pattern is a replacement pattern which is the name of the answer file.

For example, you can use `(.+)\.in` and `\1.out` to match `test-1.in` and `test-1.out`, or use `(.+)\.in\.(\d+)` and `\1.ans.\2` to match `test.in.3` and `test.ans.3`.

Expand All @@ -41,7 +41,7 @@ When loading pairs of test cases, each rule which matches an input file will be

The default path when choosing where to save an untitled tab with problem URL.

Each rule is a pair of [regular expression patterns](../general#regular-expression). The first regex matches a part of the problem URL, and the second pattern is a replacement pattern which is the default save path.
Each rule is a pair of [regular expression patterns](../general/_index.ru.md#regular-expression). The first regex matches a part of the problem URL, and the second pattern is a replacement pattern which is the default save path.

When saving a file with problem URL, if the problem URL matches at least one regex in the rules, the default save path will be the replacement of the first matching regex.

Expand Down

0 comments on commit c9245d5

Please sign in to comment.