Skip to content

Commit 16f3d5b

Browse files
优化样式
1 parent 02a3c1a commit 16f3d5b

File tree

5 files changed

+81
-7
lines changed

5 files changed

+81
-7
lines changed

docs/docs/机器学习/传统算法/K均值算法.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ K 均值算法如何划分集群:
2929
一维坐标系中,设 A(x1),B(x2),则 A,B 之间的距离为
3030

3131
$
32-
|AB|=[(x1x2)2]
32+
|AB|=\sqrt{(x1-x2)^2}
3333
$
3434

3535
二维坐标系中,设 A(x1,y1),B(x2,y2),则 A,B 之间的距离为
3636

3737
$
38-
|AB|=[(x1x2)2+(y1y2)2]
38+
|AB|=\sqrt{(x1-x2)^2+(y1-y2)^2}
3939
$
4040

4141
三维坐标系中,设 A(x1,y1,z1),B(x2,y2,z2),则 A,B 之间的距离为
4242

4343
$
44-
|AB|=[(x1x2)2+(y1y2)2+(z1z2)2]
44+
|AB|=\sqrt{(x1-x2)^2+(y1-y2)^2+(z1-z2)^2}
4545
$
4646

4747
以此类推
Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
---
22
sidebar_position: 2
33
title: Markdown
4+
description: Markdown和MDX的各种用法及示例
45
---
56

7+
## MDX
8+
9+
最常见的池化操作为<Highlight color="#25c2a0">最大值池化</Highlight>(Max Pooling)和<Highlight color="#25c2a0">平均值池化</Highlight>(Average Pooling)两种。
10+
11+
:::info
12+
点击下方划线文字,显示解释
13+
:::
14+
15+
阿伦特的《人的境况》强调了人类<HoverText text="行动" explanation="在公共领域中通过言行展现自我、与他人互动的活动,体现人的自由与多样性。" />、<HoverText text="劳动" explanation="与生物性生存直接相关的活动,满足人类基本需求(如吃饭、繁衍)。" />和<HoverText text="工作" explanation="创造持久人造物(工具、艺术品、制度)的活动,构建&quot;人造世界&quot;" />的区别。
16+
17+
618
## 拓展
719

820
### 数学公式
@@ -55,12 +67,12 @@ DSL3 --> DSL3_1(打扫)
5567
DSL3_1 --> DSL3_1_1(决定好从哪里开始清理)
5668
DSL3_1 --> DSL3_1_2(决定每样东西去留)
5769
DSL3 --> DSL3_2(收纳)
58-
DSL3_2 --> DSL3_2_1(取决于你和家里物品“友好相处”的方法)
70+
DSL3_2 --> DSL3_2_1(取决于你和家里物品友好相处的方法)
5971
DSL3_2 --> DSL3_2_2(1 out 1 in法)
6072
DSL3_2 --> DSL3_2_3(one touch 法)
6173
```
6274

63-
### 思维导图组件
75+
### 独立思维导图组件
6476

6577
<MarkmapHooks initialMarkdown={`
6678
@@ -103,7 +115,7 @@ DSL3_2 --> DSL3_2_3(one touch 法)
103115
104116
### 收纳
105117
106-
- 取决于你和家里物品友好相处的方法
118+
- 取决于你和家里物品"友好相处"的方法
107119
- 1 out 1 in法
108120
- one touch 法
109121

src/components/Highlight.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
3+
export default function Highlight({children, color}) {
4+
return (
5+
<span
6+
style={{
7+
backgroundColor: color,
8+
borderRadius: '2px',
9+
color: '#fff',
10+
padding: '0.2rem',
11+
}}>
12+
{children}
13+
</span>
14+
);
15+
}

src/components/HoverText.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import React, { useState } from 'react';
2+
3+
export default function HoverText({ text, explanation }) {
4+
const [isHovering, setIsHovering] = useState(false);
5+
6+
return (
7+
<span style={{ position: 'relative', display: 'inline-block' }}>
8+
<span
9+
style={{
10+
textDecoration: 'underline',
11+
cursor: 'pointer',
12+
color: '#1877F2'
13+
}}
14+
onMouseEnter={() => setIsHovering(true)}
15+
onMouseLeave={() => setIsHovering(false)}
16+
>
17+
{text}
18+
</span>
19+
20+
{isHovering && (
21+
<div
22+
style={{
23+
position: 'absolute',
24+
bottom: '100%',
25+
left: '50%',
26+
transform: 'translateX(-50%)',
27+
backgroundColor: 'rgba(0, 0, 0, 0.8)',
28+
color: 'white',
29+
padding: '0.5rem',
30+
borderRadius: '4px',
31+
boxShadow: '0 2px 10px rgba(0, 0, 0, 0.2)',
32+
zIndex: 1000,
33+
width: '250px',
34+
textAlign: 'center',
35+
fontSize: '0.9rem',
36+
}}
37+
>
38+
{explanation}
39+
</div>
40+
)}
41+
</span>
42+
);
43+
}

src/theme/MDXComponents/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ import MDXComponents from '@theme-original/MDXComponents';
22
import MarkmapHooks from '@site/src/components/MarkmapHooks';
33
import { PhotoAlbums } from '@site/src/components/PhotoAlbums';
44
import DocCardList from '@theme/DocCardList';
5+
import Highlight from '@site/src/components/Highlight';
6+
import HoverText from '@site/src/components/HoverText';
57

68
export default {
79
// 复用默认的映射
810
...MDXComponents,
911
PhotoAlbums,
1012
MarkmapHooks,
11-
DocCardList
13+
DocCardList,
14+
Highlight,
15+
HoverText
1216
};

0 commit comments

Comments
 (0)