-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fff9eef
commit ca94140
Showing
525 changed files
with
57 additions
and
118,627 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# update_html.py | ||
|
||
input_file_path = 'path/to/your/input/file.txt' | ||
output_html_path = 'path/to/your/output/index.html' | ||
special_marker = '<!-- Custom Marker -->' | ||
|
||
with open(input_file_path, 'r') as input_file: | ||
file_content = input_file.read() | ||
|
||
# 读取 HTML 文件内容 | ||
with open(output_html_path, 'r') as html_file: | ||
html_content = html_file.read() | ||
|
||
# 查找特殊标记 | ||
marker_index = html_content.find(special_marker) | ||
|
||
# 如果找到了特殊标记,则在特殊标记后面添加文件内容 | ||
if marker_index != -1: | ||
updated_html_content = ( | ||
html_content[:marker_index + len(special_marker)] + | ||
f'\n<div>{file_content}</div>\n' + | ||
html_content[marker_index + len(special_marker):] | ||
) | ||
else: | ||
# 如果没有找到特殊标记,则在文件末尾添加文件内容 | ||
updated_html_content = html_content + f'\n<div>{file_content}</div>\n' | ||
|
||
# 写入更新后的 HTML 内容 | ||
with open(output_html_path, 'w') as updated_html_file: | ||
updated_html_file.write(updated_html_content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Update HTML | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
update-html: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt # 如果有依赖的话 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.