File tree Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/0000-0099/0001.Tw
5
5
tags :
6
6
- 数组
7
7
- 哈希表
8
+ rating : 1234
8
9
---
9
10
10
11
# [ 1. 两数之和] ( https://leetcode.cn/problems/two-sum )
Original file line number Diff line number Diff line change 4
4
- 模拟
5
5
- 堆(优先队列)
6
6
edit_url : ' https://github.com/doocs/leetcode/edit/main/solution/0000-0099/0002.Add%20Two%20Numbers/README.md'
7
+ rating : 1345
7
8
---
8
9
9
10
# [ 2. 两数相加] ( https://leetcode.cn/problems/add-two-numbers )
Original file line number Diff line number Diff line change
1
+ from mkdocs import plugins
2
+
3
+
4
+ # https://www.mkdocs.org/dev-guide/plugins/#events
5
+
6
+
7
+ @plugins .event_priority (90 )
8
+ def on_post_page (output , page , config ):
9
+ difficulty = page .meta .get ('difficulty' )
10
+ rating = page .meta .get ('rating' )
11
+
12
+ # 在 h1 标题之后插入难度和评分信息及其样式
13
+ html = str (output )
14
+ # if difficulty:
15
+ # # 找到 h1 标签的结束位置
16
+ # h1_end = html.find('</h1>') + 5
17
+ # # 在 h1 标签之后插入难度信息
18
+ # html = html[:h1_end] + f'<p>Difficulty: {difficulty}</p>' + html[h1_end:]
19
+ # if rating:
20
+ # # 找到 h1 标签的结束位置
21
+ # h1_end = html.find('</h1>') + 5
22
+ # # 在 h1 标签之后插入评分信息
23
+ # html = html[:h1_end] + f'<p>Rating: {rating}</p>' + html[h1_end:]
24
+ return html
Original file line number Diff line number Diff line change 86
86
- hooks/tags.py
87
87
- hooks/committer.py
88
88
- hooks/fix_markdown_block.py
89
+ - hooks/ext_info.py
89
90
90
91
markdown_extensions :
91
92
- admonition
You can’t perform that action at this time.
0 commit comments