add wiki page markdown file

This commit is contained in:
qiurui 2024-01-19 14:06:36 +08:00
parent 2fbe6f773d
commit 61b2083077
1 changed files with 20 additions and 4 deletions

View File

@ -20,11 +20,27 @@ def initmd(version1,version2,source):
os.chmod(filename,448)
return filename
#初始化关键词与wiki page的markdown文件
def initwikimd():
dir = os.getcwd() + "/output/"
mkdir(dir)
filename = dir + "wikipage.md"
if os.path.exists(filename):
os.chmod(filename,448)
return filename
else:
with open(filename,mode="w") as file:
file.write("# kernel wiki page summary\n")
file.write("|keyword | wiki page | \n")
file.write("| :----- | :-------- | \n")
os.chmod(filename,448)
return filename
#参考格式
#| 2af9b20dbb39 | Sat Oct 28 08:15:07 2023 -1000 | Linus Torvalds | torvalds@linux-foundation.org
#| Merge tag 'x86-urgent-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip<br> Pull misc x86 fixes from Ingo Molnar<br> - Fix a possible CPU hotplug deadlock bug caused by the new TSC synchronization code<br> - Fix a legacy PIC discovery bug that results in device troubles on affected systems, such as non-working keybards, etc<br> - Add a new Intel CPU model number to <asm/intel-family.h><br> * tag 'x86-urgent-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:<br> &emsp;x86/tsc: Defer marking TSC unstable to a worker<br> &emsp;x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility<br> &emsp;x86/cpu: Add model number for Intel Arrow Lake mobile processor
#| fix<br> add model| X86 CPU | arch/x86/include/asm/i8259.h<br> arch/x86/include/asm/intel-family.h<br> arch/x86/kernel/acpi/boot.c<br> arch/x86/kernel/i8259.c<br> arch/x86/kernel/tsc_sync.c<br>
def add_commit_info(filename,hash,hash_list):
def add_commit_info(filename,wiki_file_name,hash,hash_list):
count = hash_list.index(hash)
print(hash)
print(count)
@ -36,11 +52,11 @@ def add_commit_info(filename,hash,hash_list):
file.write("| " + get_commit_email(hash) + " ")
file.write("| " + format(get_commit_abbr(hash),get_commit_body(hash)) + " ")
file.write("| " + get_commit_type(get_commit_body(hash)) + "<br> ")
file.write("| " + get_commit_keyword(get_commit_abbr(hash),hash) + "<br> ")
file.write("| " + get_commit_keyword(get_commit_abbr(hash),hash,wiki_file_name) + "<br> ")
file.write("| " + format_diff(get_commit_diff_files(hash)) + " |\n")
#add_commit_info多线程版本
def add_commit_info_threads(lock,filename,hash,hash_list):
def add_commit_info_threads(lock,filename,wiki_file_name,hash,hash_list):
lock.acquire()
count = hash_list.index(hash)
print(hash)
@ -53,7 +69,7 @@ def add_commit_info_threads(lock,filename,hash,hash_list):
file.write("| " + get_commit_email(hash) + " ")
file.write("| " + format(get_commit_abbr(hash),get_commit_body(hash)) + " ")
file.write("| " + get_commit_type(get_commit_body(hash)) + "<br> ")
file.write("| " + get_commit_keyword(get_commit_abbr(hash),hash) + "<br> ")
file.write("| " + get_commit_keyword(get_commit_abbr(hash),hash,wiki_file_name) + "<br> ")
file.write("| " + format_diff(get_commit_diff_files(hash)) + " |\n")
lock.release()