Skip to content

Commit 69fd5b4

Browse files
committed
docs(bi-directional-links): complete docs
1 parent a46124e commit 69fd5b4

4 files changed

Lines changed: 145 additions & 3 deletions

File tree

docs/pages/en/integrations/markdown-it-bi-directional-links/index.md

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,91 @@
44

55
[[Bi-directional Links Example Page]]
66

7+
Custom text: [[Bi-directional Links Example Page|Custom Text]]
8+
9+
Compatible to modify the HTML attributes [[Bi-directional Links Example Page|Custom Attrs]]{style="color: red;"}
10+
11+
Obsidian same name pages: [[pages/en/integrations/markdown-it-bi-directional-links/same-name/Bi-directional Links Example Same Name Page|Bi-directional Links Example Same Name Page]][[pages/en/integrations/markdown-it-bi-directional-links/Bi-directional Links Example Same Name Page|Bi-directional Links Example Same Name Page]]
12+
13+
Absolute Path: [[pages/en/integrations/markdown-it-bi-directional-links/Bi-directional Links Example Page]]
14+
715
## Introduction
816

917
**Bi-directional links** (also known as internal links), and another concept you may know and hear about [WikiLinks](https://en.wikipedia.org/wiki/Help:Link), holds a important place in the document engineering area. It is usually used to quickly establish a connection (or link) from one page to another page, and widely used in Wiki pages such as [Wikipedia](https://wikipedia.org), and now days popular tools such as [Obsidian](https://obsidian.md/) and [Logseq](https://logseq.com/).
1018

11-
This plugin is a compatible implementation version of [Obsidian](https://obsidian.md)'s [internal links](https://help.obsidian.md/Linking+notes+and+files/Internal+links), it follows two rules:
19+
This plugin is a fully featured compatible implementation version of [Obsidian](https://obsidian.md)'s [internal links](https://help.obsidian.md/Linking+notes+and+files/Internal+links), it follows two rules:
1220

1321
1. A page's file name (without extension) can be used as a link target, for example: `[[Bi-directional Links Example Page]]` will be parsed as a link to the globally unique `Bi-directional Links Example Page.md` file.
1422
2. A link target can be an absolute path, for example: `[[Some Folder/Bi-directional Links Example Page]]` will be parsed as a link to `Some Folder/Bi-directional Links Example Page.md`, usually appears when you have multiple files with the same name.
1523

16-
### Example
24+
### Examples
25+
26+
<br>
27+
28+
#### Basic
1729

1830
```markdown
1931
[[Target Page File Name]]
2032
```
2133

34+
Demo
35+
36+
[[Bi-directional Links Example Page]]
37+
38+
#### Custom Text
39+
40+
```markdown
41+
[[Target Page File Name|Custom Text]]
42+
```
43+
44+
Demo
45+
46+
[[Bi-directional Links Example Page|Custom Text]]
47+
48+
#### Compatible with [`markdown-it-attrs`](https://github.com/arve0/markdown-it-attrs) to modify HTML attributes
49+
50+
<br>
51+
52+
##### Change color
53+
54+
```markdown
55+
[[Target Page File Name]]{style="color: red;"}
56+
```
57+
58+
Demo
59+
60+
[[Bi-directional Links Example Page]]{style="color: red;"}
61+
62+
##### Change class name
63+
64+
```markdown
65+
[[Target Page File Name]]{.custom-class}
66+
```
67+
68+
Demo
69+
70+
[[Bi-directional Links Example Page]]{.custom-class}
71+
72+
### Absolute path
73+
74+
```markdown
75+
[[Some Full Path Reference to Your Page]]
76+
```
77+
78+
Demo
79+
80+
[[pages/en/integrations/markdown-it-bi-directional-links/Bi-directional Links Example Page]]
81+
82+
### Absolute path with custom text
83+
84+
```markdown
85+
[[Some Full Path Reference to Your Page|Custom Text]]
86+
```
87+
88+
Demo
89+
90+
[[pages/en/integrations/markdown-it-bi-directional-links/Bi-directional Links Example Page|Custom Text]]
91+
2292
## How to use
2393

2494
### Installation

docs/pages/zh-CN/integrations/markdown-it-bi-directional-links/index.md

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,91 @@
44

55
[[双向链接示例页面]]
66

7+
自定义文案:[[双向链接示例页面|自定义文案]]
8+
9+
兼容自定义属性:[[双向链接示例页面|自定义属性]]{style="color: red;"}
10+
11+
Obsidian 同名页面:[[pages/zh-CN/integrations/markdown-it-bi-directional-links/same-name/双向链接示例同名页面|双向链接示例同名页面]][[pages/zh-CN/integrations/markdown-it-bi-directional-links/双向链接示例同名页面|双向链接示例同名页面]]
12+
13+
绝对路径:[[pages/zh-CN/integrations/markdown-it-bi-directional-links/双向链接示例页面]]
14+
715
## 介绍
816

917
**双向链接** (也被称之为内部链接,英文 Bi-directional links 和 Internal links),和也许你也了解和听说过另一个有关的概念 [WikiLinks](https://en.wikipedia.org/wiki/Help:Link),在文档工程中有着非常重要的地位,它通常用于快速的建立一个页面到另一个页面的连接(或者链接),在 [Wikipedia](https://wikipedia.org) 这样的 Wiki 框架中,以及现在所流行的 [Obsidian](https://obsidian.md/)[Logseq](https://logseq.com/) 中都被广泛使用。
1018

11-
这个插件是 [Obsidian](https://obsidian.md)[内部链接](https://help.obsidian.md/Linking+notes+and+files/Internal+links)的兼容实现版本,它遵循两条规则:
19+
这个插件是 [Obsidian](https://obsidian.md)[内部链接](https://help.obsidian.md/Linking+notes+and+files/Internal+links)的全功能兼容实现版本,它遵循两条规则:
1220

1321
1. 一个页面的文件名称(不包含扩展名)可以作为一个链接的目标,例如:`[[双向链接示例页面]]` 将会被解析为一个指向全局唯一的 `双向链接示例页面.md` 文件的链接。
1422
2. 一个链接的目标可以是一个绝对路径,例如:`[[某个文件夹/双向链接示例页面]]` 将会被解析为一个指向 `某个文件夹/双向链接示例页面.md` 的链接,通常出现在你有多个同名文件的时候。
1523

1624
### 用法示例
1725

26+
<br>
27+
28+
#### 基本用法
29+
1830
```markdown
1931
[[双向链接目标页面的文件名称]]
2032
```
2133

34+
效果
35+
36+
[[双向链接示例页面]]
37+
38+
#### 改显示的文案
39+
40+
```markdown
41+
[[双向链接目标页面的文件名称|自定义文案]]
42+
```
43+
44+
效果
45+
46+
[[双向链接示例页面|自定义文案]]
47+
48+
#### 兼容 [`markdown-it-attrs`](https://github.com/arve0/markdown-it-attrs) 修改 HTML 属性(Attribute)
49+
50+
<br>
51+
52+
##### 改颜色
53+
54+
```markdown
55+
[[双向链接目标页面的文件名称]]{style="color: red;"}
56+
```
57+
58+
效果
59+
60+
[[双向链接示例页面]]{style="color: red;"}
61+
62+
##### 改类名
63+
64+
```markdown
65+
[[双向链接目标页面的文件名称]]{.some-class}
66+
```
67+
68+
效果
69+
70+
[[双向链接示例页面]]{.some-class}
71+
72+
#### 绝对路径
73+
74+
```markdown
75+
[[某个完整路径]]
76+
```
77+
78+
效果
79+
80+
[[pages/zh-CN/integrations/markdown-it-bi-directional-links/双向链接示例页面]]
81+
82+
#### 绝对路径和自定义文案
83+
84+
```markdown
85+
[[某个文件夹|自定义文案]]
86+
```
87+
88+
效果
89+
90+
[[pages/zh-CN/integrations/markdown-it-bi-directional-links/双向链接示例页面|自定义文案]]
91+
2292
## 如何使用
2393

2494
### 安装
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# 同名页面
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# 同名页面

0 commit comments

Comments
 (0)