Skip to content

Commit

Permalink
update papers from Prof. Toby Li
Browse files Browse the repository at this point in the history
  • Loading branch information
boyugou committed Dec 18, 2024
1 parent 66ed9cf commit e1114ce
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ jobs:
- name: Run update_template_or_data/utils/scripts/sort_by_date.py
run: |
python update_template_or_data/utils/scripts/sort_by_date.py
- name: Generate keyword grouping and update temp_readme.md
run: |
# Concatenate all keyword-specific markdown files into a single block
GROUPED_KEYWORDS=""
for file in paper_by_key/*.md; do
KEYWORD=$(basename "$file" .md | sed 's/^paper_//')
GROUPED_KEYWORDS+="## $KEYWORD Papers\n\n"
GROUPED_KEYWORDS+="$(cat "$file")\n\n"
done
# Insert keyword grouping into the readme template
sed -i '/{{insert_keyword_groups_here}}/{
r /dev/stdin
d
}' update_template_or_data/update_readme_template.md <<< "$GROUPED_KEYWORDS"
- name: Update temp_readme.md with sorted papers content
run: |
Expand Down
6 changes: 2 additions & 4 deletions update_template_or_data/update_readme_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ This paper list covers a variety of papers related to GUI Agents, including but
|--------------------------------|---------------------------------------|------------------------------------------|----------------------------------|------------------------------------|


[//]: # (## Papers Grouped by Keywords)

[//]: # ()
[//]: # (TBD)
## Papers Grouped by Keywords
{{insert_keyword_groups_here}}

## All Papers (from most recent to oldest)
<details open>
Expand Down
31 changes: 31 additions & 0 deletions update_template_or_data/utils/scripts/sort_by_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,37 @@ def remove_square_brackets(s):
keywords_to_group = predefined_keywords.union(top_keywords)

# Create directory for keyword-based grouping

import shutil

def clear_folder(folder_path):
try:
# 检查文件夹是否存在
if not os.path.exists(folder_path):
print(f"文件夹 '{folder_path}' 不存在!")
return

# 遍历文件夹中的所有文件和子文件夹
for item in os.listdir(folder_path):
item_path = os.path.join(folder_path, item)

# 如果是文件,删除文件
if os.path.isfile(item_path):
os.remove(item_path)

# 如果是文件夹,删除整个文件夹
elif os.path.isdir(item_path):
shutil.rmtree(item_path)

print(f"文件夹 '{folder_path}' 已成功清空!")

except Exception as e:
print(f"清空文件夹时出错: {e}")

# 使用示例
folder_to_clear = "paper_by_key"
clear_folder(folder_to_clear)

subgroup_dir = "paper_by_key"
if not os.path.exists(subgroup_dir):
os.makedirs(subgroup_dir)
Expand Down

0 comments on commit e1114ce

Please sign in to comment.