Skip to content

Instantly share code, notes, and snippets.

@etler
etler / index.html
Last active November 9, 2018 01:08
Automatically generated client-side TOC for github pages
<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>`;
}