mirror of
https://github.com/fmhy/edit.git
synced 2026-01-18 01:41:52 +11:00
feat: automate single-page
This commit is contained in:
parent
b836367c87
commit
04c167fde7
2 changed files with 59 additions and 0 deletions
25
.github/single-page.py
vendored
Normal file
25
.github/single-page.py
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import os
|
||||
import glob
|
||||
import time
|
||||
import re
|
||||
|
||||
def output():
|
||||
read = glob.glob("*.md")
|
||||
content = ""
|
||||
for file in read:
|
||||
if file != "single-page.md" and file != "README.md":
|
||||
with open(file, "r") as f:
|
||||
content += f.read()
|
||||
return content
|
||||
|
||||
def main():
|
||||
content = output()
|
||||
with open("single-page", "w") as file:
|
||||
file.write(content)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
s = time.perf_counter()
|
||||
main()
|
||||
elapsed = time.perf_counter() - s
|
||||
print(f"{__file__} executed in {elapsed:0.2f} seconds.")
|
||||
Loading…
Add table
Add a link
Reference in a new issue