1 Star 2 Fork 0

编程语言算法集 / hacker-howto

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
toc.js 1007 Bytes
一键复制 编辑 原始数据 按行查看 历史
Zer4tul Ke 提交于 2015-07-08 18:31 . Init commit as a independent repo
(function(window) {
String.prototype.repeat = function(num) {
return new Array(num + 1).join(this);
};
var url = document.URL,
headers = jQuery("article :header"),
result;
for (var i = 3; i < headers.length; i++) { //skip H1, history, and toc
var header = headers[i],
headerText = header.textContent.trim();
var anchorText = headerText.toLowerCase();
anchorText = anchorText.replace(" ", "-");
anchorText = anchorText.replace(/,|:|、/g, "");
var hIndex = parseInt(header.nodeName.substring(1)) - 1,
indent = " ".repeat(hIndex),
link = ['<pre>', indent, '* [', headerText, '](', '#', anchorText, ')', '\n', '</pre>'];
result += link.join('');
}
var win = window.open("", "win");
win.document.body.innerHTML = result;
})(window);
1
https://gitee.com/TheAlgorithms/hacker-howto.git
git@gitee.com:TheAlgorithms/hacker-howto.git
TheAlgorithms
hacker-howto
hacker-howto
master

搜索帮助