forked from horseee/Awesome-Efficient-LLM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_item.py
61 lines (52 loc) · 1.86 KB
/
generate_item.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
paper_name = ''
paper_url = ''
github_url = ''
author_name = ''
image_path = 'figures/{}.png'.format('')
conference = ""
star_format = '[![Star](https://img.shields.io/github/stars/{}.svg?style=social&label=Star)](https://github.com/{})'
conference_format = "[![Publish](https://img.shields.io/badge/Conference-{}-blue)]()"
markdown_type = 'simple'
final_str = "* "
if len(conference) > 0:
conference_item = conference_format.format(conference)
final_str += conference_item
final_str += " "
if len(github_url) > 0:
github_item = '/'.join(github_url.split('/')[-2:])
final_str += star_format.format(github_item, github_item)
final_str += " "
final_str += "[{}]({}). {}. [[Paper]]({})".format(paper_name, paper_url, author_name, paper_url)
if len(github_url) > 0:
final_str += "[[Github]]({})".format(github_url)
print(final_str)
print()
markdown_type = "complex"
main_item_format = '[{}]({}) <br> {} |'
image_format = '<img width="1002" alt="image" src="{}"> |'
github_format = '[Github]({}) <br> '
paper_format = '[Paper]({})'
publish = 'https://img.shields.io/badge/Conference-{}-blue'.format(conference)
final_str = "|"
flag = False
if len(github_url) > 0:
github_item = '/'.join(github_url.split('/')[-2:])
final_str += star_format.format(github_item, github_item)
flag = True
if len(conference) > 0:
conference_item = conference_format.format(conference)
final_str += conference_item
flag = True
if flag:
final_str += '<br>'
final_str += main_item_format.format(paper_name, paper_url, author_name)
final_str += image_format.format(image_path)
if len(github_url) > 0:
final_str += github_format.format(github_url)
final_str += paper_format.format(paper_url)
import time
month = time.strftime("%m", time.localtime())
day = time.strftime("%d", time.localtime())
final_str += '|'
final_str += f"[//]: #{month}/{day}"
print(final_str)