Skip to content

Commit

Permalink
Merge pull request #197 from HuangFuSL/doc-patch
Browse files Browse the repository at this point in the history
Patch: fix display issues
  • Loading branch information
HuangFuSL authored Aug 18, 2023
2 parents a7e06a4 + f1cdc07 commit 026bf67
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/coding/configuration/vim.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
todo: true
---

# Vim

Vim是基于命令行的文本编辑器。
Expand All @@ -14,6 +18,7 @@ Vim的交互命令如下表所列,交互命令以`:`开头。
|`Ctrl+V`|选择块|`i`|切换到插入模式|

|输入|功能|输入|功能|
|:-:|:-:|:-:|:-:|
|`:q`|退出Vim|`:q!`|退出而不保存|
|`:w`|保存|`<Esc>`|退出插入模式|
|`:h`|查询帮助|`:version`|查询版本和功能|
Expand Down
8 changes: 6 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@ hide:
* [论文笔记](papers/index.md)
* [关于我](about.md)

## :material-timeline-clock: Blog timeline
### :material-timeline-clock: Blog timeline

::timeline:: class="home-timeline"

{{ build_timeline(10) }}

::/timeline::

## :material-pen-plus: Recent updates
### :material-pen-plus: Recent updates

{{ build_recent(5) }}

### :material-typewriter: Currently working on

{{ build_todo() }}

## :material-palette: Customization

Click on the buttons to change the primary color.
Expand Down
4 changes: 4 additions & 0 deletions docs/math/empirical-methods/potential-outcome-framework.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
todo: true
---

# Potential Outcome Framework

* Unit of analysis:不同时间下的同一个个体应当看作不同的个体
Expand Down
1 change: 1 addition & 0 deletions main/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ def define_env(env: plugin.MacrosPlugin):
env.macro(network.remote_content)
env.macro(metadata.build_timeline)
env.macro(metadata.build_recent)
env.macro(metadata.build_todo)
env.filter(len)
14 changes: 14 additions & 0 deletions main/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,20 @@ def build_recent(topk: int) -> str:
for page in pages[:topk]
])

def build_todo() -> str:
global _page_meta_original
pages: List[Dict[str, Any]] = [
{
'url': v['file'],
'title': f"[{v['title']}]({v['file']})"
}
for v in _page_meta_original.values()
if criteria(v) and ('todo' in v['meta'] and v['meta']['todo']) # type: ignore
]
pages.sort(key=lambda _: _['title'], reverse=True)
if pages:
return '\n'.join([f"* {page['title']}" for page in pages])
return 'TODO list is clear!'

def filter_pages(category: str) -> List[Dict[str, str | Dict[str, str]]]:
global _page_meta_original
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mkdocs-jupyter==0.24.2
pymdown-extensions==10.1
matplotlib==3.7.2
pandas==2.0.3
scikit-learn==1.3.0
jupyter==1.0.0
requests==2.31.0
jieba==0.42.1
Expand Down

0 comments on commit 026bf67

Please sign in to comment.