Skip to content

Commit f6ad4bb

Browse files
committed
Ensure alphabetical order on index page
1 parent 8bac0b3 commit f6ad4bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

generator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@
7373
# Generate tldr pages index.html
7474
with open(os.path.join(doc_path, "index.html"), "w+") as html:
7575
html.write('<html><!-- Online page at '+online_url+' --><head></head><body><h1>TLDR pages Docset</h1><br/>powered by <a href="http://tldr-pages.github.io">tldr-pages.github.io/</a>')
76-
for dir in os.listdir(doc_path):
76+
for dir in sorted(os.listdir(doc_path)):
7777
if os.path.isdir(os.path.join(doc_path, dir)):
7878
html.write("<h2>%s</h2><ul>" % dir)
79-
html.writelines(['<li><a href="%s/%s">%s</a></li>' % (dir, f, f[:-5]) for f in os.listdir(os.path.join(doc_path, dir))])
79+
html.writelines(['<li><a href="%s/%s">%s</a></li>' % (dir, f, f[:-5]) for f in sorted(os.listdir(os.path.join(doc_path, dir)))])
8080
html.write("</ul>")
8181
html.write('</body></html>')
8282

0 commit comments

Comments
 (0)