Skip to content

Instantly share code, notes, and snippets.

@etler
etler / index.html
Last active Nov 9, 2018
Automatically generated client-side TOC for github pages
View index.html
<html>
<body>
<script>
(async () => {
const response = await fetch('https://api.github.com/repos/:user/:repo/contents/');
const data = await response.json();
let htmlString = '<ul>';
for (let file of data) {
htmlString += `<li><a href="${file.path}">${file.name}</a></li>`;
}