Skip to content

Commit 4beeeab

Browse files
committed
Add title and table of contents to index page
- https://kapeli.com/docsets#tableofcontents
1 parent 2332869 commit 4beeeab

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

generator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@
7373

7474
# Generate tldr pages index.html
7575
with open(os.path.join(doc_path, "index.html"), "w+") as html:
76-
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>')
76+
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>')
7777
for dir in sorted(os.listdir(doc_path)):
7878
if os.path.isdir(os.path.join(doc_path, dir)):
79-
html.write("<h2>%s</h2><ul>" % dir)
79+
html.write('<a name="//apple_ref/cpp/Section/{name}" class="dashAnchor"></a><h2>{name}</h2><ul>'.format(name=dir))
8080
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)))])
8181
html.write("</ul>")
8282
html.write('</body></html>')

static/Info.plist

+2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@
1212
<true/>
1313
<key>dashIndexFilePath</key>
1414
<string>index.html</string>
15+
<key>DashDocSetFamily</key>
16+
<string>dashtoc</string>
1517
</dict>
1618
</plist>

0 commit comments

Comments
 (0)