Skip to content

Commit

Permalink
Add title and table of contents to index page
Browse files Browse the repository at this point in the history
  • Loading branch information
cvn committed Feb 12, 2018
1 parent 2332869 commit 4beeeab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@

# Generate tldr pages index.html
with open(os.path.join(doc_path, "index.html"), "w+") as html:
html.write('<html><!-- Online page at '+online_url+' --><head><meta charset="UTF-8"></head><body><h1>TLDR pages Docset</h1><br/>powered by <a href="http://tldr-pages.github.io">tldr-pages.github.io/</a>')
html.write('<html><!-- Online page at '+online_url+' --><head><meta charset="UTF-8"><title>TLDR pages</title></head><body><h1>TLDR pages</h1><br/>powered by <a href="http://tldr-pages.github.io">tldr-pages.github.io/</a>')
for dir in sorted(os.listdir(doc_path)):
if os.path.isdir(os.path.join(doc_path, dir)):
html.write("<h2>%s</h2><ul>" % dir)
html.write('<a name="//apple_ref/cpp/Section/{name}" class="dashAnchor"></a><h2>{name}</h2><ul>'.format(name=dir))
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)))])
html.write("</ul>")
html.write('</body></html>')
Expand Down
2 changes: 2 additions & 0 deletions static/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@
<true/>
<key>dashIndexFilePath</key>
<string>index.html</string>
<key>DashDocSetFamily</key>
<string>dashtoc</string>
</dict>
</plist>

0 comments on commit 4beeeab

Please sign in to comment.