Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 04d01dd

Browse filesBrowse files
committed
Update pages for markdown
1 parent bc56e5d commit 04d01dd
Copy full SHA for 04d01dd

File tree

Expand file treeCollapse file tree

2 files changed

+15
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+15
-8
lines changed

‎utils/config.py

Copy file name to clipboardExpand all lines: utils/config.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</div>
3939
4040
## 说明
41-
下面列表根据拼音排序,可点击链接下载二进制文件,或者打开文本文件。<a href="{DOWNLOAD}" style="color:red" target="_black">点击这里</a>**下载当前整个文件夹**(此功能由 [DownGit](http://downgit.zhoudaxiaa.com) 提供)。此页面[mbinary](https://mbinary.xyz) 制作
41+
下面列表根据拼音排序,可点击下面的的链接下载二进制文件,或者打开文本文件。<a href="{DOWNLOAD}" style="color:red;text-decoration:underline;" target="_black">点击这里</a>**下载当前整个文件夹**(此功能由 [DownGit](http://downgit.zhoudaxiaa.com) 提供)。此页面由 [mbinary](https://mbinary.xyz) 制作
4242
4343
## Directories
4444
<ul>{dirLst}</ul>

‎utils/genIndex.py

Copy file name to clipboardExpand all lines: utils/genIndex.py
+14-7Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,12 @@ def genIndex(path,dirs,files,htmlTemp = HTML):
8585
#<hr>\n<span style="color:orange;text-align:center;">Read Me</span>\n<hr>\n
8686
md = '\n<h1 style="color:red;text-align:center;">Read Me</h1>\n'+f.read()
8787
cur = getPath(path)
88-
dirLst = genDirectoryList(path,dirs)
89-
fileLst = genFileList(path,files)
90-
cont = htmlTemp.format(DOWNLOAD=DOWNLOAD+path,cur=cur,dirLst = dirLst,fileLst = fileLst,readme=md2html(md))
9188
tar = os.path.join(TARDIR ,path)
9289
if not os.path.exists(tar):os.mkdir(tar)
90+
91+
dirLst = genDirectoryList(path,dirs)
92+
fileLst = genFileList(path,files,tar)
93+
cont = htmlTemp.format(DOWNLOAD=DOWNLOAD+path,cur=cur,dirLst = dirLst,fileLst = fileLst,readme=md2html(md))
9394
filename = os.path.join(tar, NAME)
9495
with open(filename,'w') as f:
9596
f.write(cont)
@@ -106,10 +107,16 @@ def getPath(path):
106107
return '/'.join(res[::-1])
107108

108109
LIITEM = '<li><a href="{path}"><i class="fa fa-{icon}"></i>&nbsp;{name}</a></li>'
109-
def genFileList(path,files):
110-
keys=[i for i in files if i[0]!='.']
111-
link= {i:os.path.join(path,i) for i in keys}
112-
lst = [LIITEM.format(icon=getIcon(key),name = key+'---({})'.format(getSize(link[key])),path = os.path.join(PATH,link[key])) for key in keys]
110+
def genFileList(path,files,tar = TARDIR):
111+
files = [i for i in files if not i.startswith('.')]
112+
link = {}
113+
for k in files:
114+
if k.endswith('.md'):
115+
shutil.copy(os.path.join(path,k),tar)
116+
link[k] = k[:-3] + '.html'
117+
else:
118+
link[k] = os.path.join(PATH,path,k)
119+
lst = [LIITEM.format(icon=getIcon(key),name = key+'---({})'.format(getSize(os.path.join(path,key))),path = link[key]) for key in files]
113120
if lst==[]: lst.append('<li><i class="fa fa-meh-o"></i>&nbsp;None</li>')
114121
return '\n'.join(lst)
115122

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.