Visit the README.md on GitHub.
Paste this into the console in Google Chrome.
[].map
.call(document.querySelectorAll('.anchor'), el =>
`* [${el.parentNode.innerText}](${el.getAttribute('href')})`
)
.join('\n');
The output if run on the lodash README should look something like this;
"* [lodash v4.14.0](#lodash-v4140) * [Download](#download) * [Why Lodash?](#why-lodash) * [Module Formats](#module-formats)"
The following version is longer, but will indent the items according to the headers;
[].map
.call(document.querySelectorAll('.anchor'), function(el) {
var indents = ' '.repeat(parseFloat(el.parentNode.nodeName.charAt(1)) - 1);
var label = el.parentNode.innerText;
var link = el.getAttribute('href');
return `${indents}* [${label}](${link})`
})
.join('\n');
The output if run on the lodash README should look something like this;
"* [lodash v4.15.0](#lodash-v4150) * [Download](#download) * [Why Lodash?](#why-lodash) * [Module Formats](#module-formats)"