Skip to content

Commit

Permalink
Merge pull request #281 from RyoJerryYu/feat/add-obsidian-rich-feature
Browse files Browse the repository at this point in the history
Feat/add obsidian rich feature
  • Loading branch information
RyoJerryYu authored Apr 14, 2024
2 parents 1fadc34 + 8390a54 commit 56d0caf
Show file tree
Hide file tree
Showing 35 changed files with 1,652 additions and 166 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"dependencies": {
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@excalidraw/excalidraw": "^0.17.0",
"@mdx-js/mdx": "^2.3.0",
"@mdx-js/react": "^2.3.0",
"@mui/base": "^5.0.0-alpha.119",
Expand All @@ -29,6 +30,7 @@
"eslint-config-next": "13.2.1",
"gray-matter": "^4.0.3",
"isomorphic-git": "^1.21.0",
"mdast-util-mdx-jsx": "^3.1.2",
"mermaid": "^9.4.0",
"next": "13.2.1",
"next-mdx-remote": "^4.3.0",
Expand Down
32 changes: 21 additions & 11 deletions public/content/articles/2021-01-11-Sort-algorithm.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
created_at: 2021-01-11 22:57:10
updated_at: 2022-03-27 21:30:33+08:00
updated_at: 2024-04-14 21:30:33+08:00
layout: post
title: "排序算法"
subtitle: "来讲讲我所理解的排序算法"
Expand Down Expand Up @@ -121,11 +121,13 @@ tags:

则有:

$$\begin{aligned}
$$
\begin{aligned}
T(n)&=(n+1)\times O(logn)\\
&=O(n)\times O(logn)\\
&=O(nlogn)
\end{aligned}$$
\end{aligned}
$$

### 额外空间复杂度

Expand Down Expand Up @@ -284,13 +286,16 @@ tags:

每次插入时间:

$$\begin{aligned} T(i) &= h\\
$$
\begin{aligned} T(i) &= h\\
&= logi
\end{aligned}$$
\end{aligned}
$$

则有总时间:

$$\begin{aligned}
$$
\begin{aligned}
T(n) &= \sum_{i=0}^{n}logi\\
&= 1\times1 + 2\times2+ 3\times4 + ...+h\times \frac{n}{2} \\
\\
Expand All @@ -301,7 +306,8 @@ tags:
\\
T(n) &= nlogn - O(2^h) \\
&= O(nlogn)
\end{aligned}$$
\end{aligned}
$$

即时间复杂度为 $$O(nlogn)$$

Expand All @@ -311,13 +317,16 @@ tags:

第i个元素合并时,时间为:

$$\begin{aligned}
$$
\begin{aligned}
T(i) &= h_{子堆}
\end{aligned}$$
\end{aligned}
$$

则有总时间:

$$\begin{aligned}
$$
\begin{aligned}
T(n) &= \sum_{i=0}^{n} (h_{子堆}) \\
&= h + (h-1)\times2 + ... + 2 \times \frac{n}{4} + 1 \times\frac{n}{2}\\
\\
Expand All @@ -327,7 +336,8 @@ tags:
\\
T(n) &= O(n) - h \\
&= O(n)
\end{aligned}$$
\end{aligned}
$$

即时间复杂度为 $$O(n)$$

Expand Down
190 changes: 190 additions & 0 deletions public/content/ideas/blog-syntax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
---
title: 博客语法渲染测试
tags:
- Blog
- Nextjs
---

# 一级标题

## 二级标题

### 三级标题

#### 四级标题

##### 五级标题

###### 六级标题

**加粗**

*斜体*

***加粗斜体***

~~删除线~~

> 引用
# 其他 MD 语法

## 代码块

`行内代码`

代码块高亮:

```python
# 代码块
def func_echo(s: str):
print(s)


class HelloPrinter:
printer: Callable[[str]]

def __init__(self, printer: Callable[[str]]):
self.printer = printer

def call(self, s: str):
self.printer(s)


p = HelloPrinter(func_echo)
p.call("hello world!")
```

大围栏

````markdown
```
def func_echo(s: str):
print(s)
```
````

## 列表

- 无序列表
- 无序列表
- 无序列表
- 无序列表

1. 有序列表
2. 有序列表
3. 有序列表

## 链接

[链接](https://blog.ryo-okami.xyz)

[站内链接](/ideas/blog-syntax)

## 图片

图片:

![图片](https://blog.ryo-okami.xyz/content/articles/2022-07-31-why-homogeneous/OnOneLineWillStillOneLine_ManimCE_v0.16.0.post0.gif)

站内图片:

![站内图片](/content/articles/2022-07-31-why-homogeneous/OnOneLineWillStillOneLine_ManimCE_v0.16.0.post0.gif)

## 表格

| 表头 | 表头 | 表头 |
| ---- | ---- | ---- |
| 单元 | 单元 | 单元 |
| 单元 | 单元 | 单元 |

## 脚注

下标[^1]

[^1]: 注释

# 插件

## Katex

行间公式

$$
\begin{aligned}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xy
\end{aligned}
$$

行内公式 $E=mc^2$

## Mermaid

mermaid 流程图

```mermaid
graph LR
A[方形] --> B(圆角)
B --> C{条件}
C -->|a=1| D[结果1]
C -->|a=2| E[结果2]
C -->|a=3| F[结果3]
```

mermaid 时序图

```mermaid
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail...
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```

## Heading 引用

点击能够跳转:

[文章内标题引用](#一级标题)

[跨文章标题引用](/ideas/blog-syntax#一级标题)

# Obsidian 短引用

## 图片

短引用图片,纯文件名

![[test-img-show-image.png]]

短引用图片,带注释

![[test-img-show-image.png|这是一张图片]]

短引用图片,带路径

![[blog-syntax/test-img-show-image.png]]

短引用图片,带路径和注释

![[blog-syntax/test-img-show-image.png|这是一张图片]]

短引用图片,全路径

![[/content/ideas/blog-syntax/test-img-show-image.png]]

## Excalidraw

短引用 Excalidraw

![[Drawing 2024-04-13 17.33.27.excalidraw]]


Loading

0 comments on commit 56d0caf

Please sign in to comment.