diff --git a/docs/coding/configuration/vim.md b/docs/coding/configuration/vim.md index 4cf5f7d3c..df0c8a82b 100644 --- a/docs/coding/configuration/vim.md +++ b/docs/coding/configuration/vim.md @@ -1,3 +1,7 @@ +--- +todo: true +--- + # Vim Vim是基于命令行的文本编辑器。 @@ -14,6 +18,7 @@ Vim的交互命令如下表所列,交互命令以`:`开头。 |`Ctrl+V`|选择块|`i`|切换到插入模式| |输入|功能|输入|功能| +|:-:|:-:|:-:|:-:| |`:q`|退出Vim|`:q!`|退出而不保存| |`:w`|保存|``|退出插入模式| |`:h`|查询帮助|`:version`|查询版本和功能| diff --git a/docs/index.md b/docs/index.md index d77dcd958..3ee07561e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -14,7 +14,7 @@ hide: * [论文笔记](papers/index.md) * [关于我](about.md) -## :material-timeline-clock: Blog timeline +### :material-timeline-clock: Blog timeline ::timeline:: class="home-timeline" @@ -22,10 +22,14 @@ hide: ::/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. diff --git a/docs/math/empirical-methods/potential-outcome-framework.md b/docs/math/empirical-methods/potential-outcome-framework.md index 49a55941f..9cf6f5927 100644 --- a/docs/math/empirical-methods/potential-outcome-framework.md +++ b/docs/math/empirical-methods/potential-outcome-framework.md @@ -1,3 +1,7 @@ +--- +todo: true +--- + # Potential Outcome Framework * Unit of analysis:不同时间下的同一个个体应当看作不同的个体 diff --git a/main/__init__.py b/main/__init__.py index a44a341f5..9f2fec2bf 100644 --- a/main/__init__.py +++ b/main/__init__.py @@ -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) diff --git a/main/metadata.py b/main/metadata.py index c618436a0..cbb565ef1 100644 --- a/main/metadata.py +++ b/main/metadata.py @@ -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 diff --git a/requirements.txt b/requirements.txt index dfd8309da..d6a260cf4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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