2016-11-06 12:08:40 -06:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
|
|
|
|
<title>Go Ethereum Guide</title>
|
|
|
|
<link rel="icon" type="image/png" href="../static/images/favicon.png" />
|
|
|
|
|
|
|
|
<link href="../static/styles/bootstrap.min.css" rel="stylesheet" />
|
|
|
|
<link href="../static/styles/flatly.min.css" rel="stylesheet" />
|
|
|
|
<link href="../static/styles/font-awesome.min.css" rel="stylesheet" />
|
2017-01-05 09:19:42 -06:00
|
|
|
<link href="../static/styles/highlight.min.css" rel="stylesheet" />
|
2016-11-06 12:08:40 -06:00
|
|
|
|
|
|
|
<link href="../static/styles/custom/common.css" rel="stylesheet" />
|
|
|
|
|
|
|
|
<script src="../static/scripts/jquery.min.js"></script>
|
|
|
|
<script src="../static/scripts/bootstrap.min.js"></script>
|
|
|
|
<script src="../static/scripts/moment.min.js"></script>
|
|
|
|
<script src="../static/scripts/marked.min.js"></script>
|
|
|
|
<script src="../static/scripts/emojify.min.js"></script>
|
2017-01-05 09:19:42 -06:00
|
|
|
<script src="../static/scripts/highlight.min.js"></script>
|
|
|
|
<script src="../static/scripts/highlight-java.min.js"></script>
|
|
|
|
<script src="../static/scripts/highlight-gradle.min.js"></script>
|
|
|
|
<script src="../static/scripts/highlight-swift.min.js"></script>
|
2016-11-23 06:14:38 -06:00
|
|
|
|
|
|
|
<script src="../static/scripts/custom/polyfills.js"></script>
|
2016-11-06 12:08:40 -06:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<nav class="navbar navbar-default navbar-fixed-top">
|
|
|
|
<div class="container">
|
|
|
|
<div class="navbar-header">
|
|
|
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
|
|
|
<span class="sr-only">Toggle navigation</span>
|
|
|
|
<span class="icon-bar"></span>
|
|
|
|
<span class="icon-bar"></span>
|
|
|
|
<span class="icon-bar"></span>
|
|
|
|
</button>
|
|
|
|
<a class="navbar-brand" href="../">Go Ethereum</a>
|
|
|
|
</div>
|
|
|
|
<div id="navbar" class="navbar-collapse collapse">
|
|
|
|
<ul class="nav navbar-nav">
|
2016-11-23 06:04:24 -06:00
|
|
|
<li><a href="../install/">Install</a></li>
|
|
|
|
<li><a href="../downloads/">Downloads</a></li>
|
|
|
|
<li class="active"><a href="../guide/">Guide</a></li>
|
2016-11-06 12:08:40 -06:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
|
2016-11-22 02:35:56 -06:00
|
|
|
<div class="container" style="padding-top: 24px;">
|
2016-11-06 12:08:40 -06:00
|
|
|
<div class="row">
|
2016-11-22 02:35:56 -06:00
|
|
|
<div class="col-md-3" id="toc" style="padding-top: 16px;"></div>
|
2016-11-06 12:08:40 -06:00
|
|
|
<div class="col-md-9" id="content"></div>
|
|
|
|
</div>
|
|
|
|
<hr/>
|
|
|
|
<footer>
|
|
|
|
<p>© 2013-2016. The go-ethereum Authors.</p>
|
|
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
// Download the go-ethereum wiki sidebar and convert it into a guide sidebar
|
|
|
|
$.ajax({
|
2016-11-22 02:35:56 -06:00
|
|
|
url: 'https://raw.githubusercontent.com/wiki/ethereum/go-ethereum/Developer-Guide.md',
|
2016-11-06 12:08:40 -06:00
|
|
|
error: function() {
|
|
|
|
alert("Failed to load latest release!");
|
|
|
|
},
|
|
|
|
dataType: 'text',
|
|
|
|
success: function(data) {
|
|
|
|
// Iterate over all the lines of the sidebar markdown
|
|
|
|
var lines = data.split("\n");
|
|
|
|
|
|
|
|
var toc = $("#toc");
|
|
|
|
var menu;
|
|
|
|
|
2017-01-05 09:19:42 -06:00
|
|
|
var head;
|
2016-11-06 12:08:40 -06:00
|
|
|
for (var i = 0; i < lines.length; i++) {
|
|
|
|
// Skip any empty lines
|
|
|
|
var line = lines[i].trim();
|
|
|
|
if (line == "") {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
// If the line is a heading, add a new menu entry
|
|
|
|
if (line[0] == "#") {
|
|
|
|
while (line.length > 0 && line[0] == "#") {
|
|
|
|
line = line.slice(1);
|
|
|
|
}
|
2017-01-05 09:19:42 -06:00
|
|
|
head = line.trim();
|
2016-11-06 12:08:40 -06:00
|
|
|
menu = $("<div class='list-group'></div>").appendTo(toc);
|
2017-01-05 09:19:42 -06:00
|
|
|
$("<a href='#' class='list-group-item active'>" + head + "</a>").appendTo(menu);
|
2016-11-06 12:08:40 -06:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
// Otherwise if the line is a link, add a new entry to the sub-menu
|
|
|
|
if (line[0] == "[") {
|
|
|
|
var name = /\[(.*)\]/g.exec(line)[1];
|
|
|
|
|
|
|
|
var link = /\((.*)\)/g.exec(line)[1];
|
|
|
|
link = "https://raw.githubusercontent.com/wiki/" + link.slice("https://github.com/".length).replace("wiki/", "") + ".md";
|
|
|
|
|
|
|
|
var item = $("<a href='#' class='list-group-item'>" + name + "</a>").appendTo(menu);
|
2017-01-05 09:19:42 -06:00
|
|
|
$(item).click(function(head, name, link) {
|
2016-11-06 12:08:40 -06:00
|
|
|
return function() {
|
|
|
|
$.ajax({
|
|
|
|
url: link,
|
|
|
|
error: function() {
|
|
|
|
$('#content').html("<div class='alert alert-dismissible alert-danger'>Failed to load guide page \"" + name + "\". Please report this issue on our <a href='https://github.com/ethereum/go-ethereum/issues' class='alert-link'>bug tracker</a>. Thank you!</div>");
|
|
|
|
},
|
|
|
|
dataType: 'text',
|
|
|
|
success: function(data) {
|
2017-01-05 09:19:42 -06:00
|
|
|
$('#content').html("<h1>" + head + ": " + name + "</h1>" + marked(data));
|
2016-11-06 12:08:40 -06:00
|
|
|
emojify.setConfig({img_dir: '../static/images/emoji'});
|
|
|
|
emojify.run(document.getElementById('content'));
|
2017-01-05 09:19:42 -06:00
|
|
|
|
|
|
|
$('pre code').each(function(i, block) {
|
|
|
|
console.log("hl", i, block);
|
|
|
|
hljs.highlightBlock(block);
|
|
|
|
});
|
2016-11-06 12:08:40 -06:00
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
2017-01-05 09:19:42 -06:00
|
|
|
}(head, name, link));
|
2016-11-06 12:08:40 -06:00
|
|
|
}
|
|
|
|
}
|
2017-01-05 09:19:42 -06:00
|
|
|
// Menu constructed, load the first entry
|
|
|
|
console.log(menu.children()[1].click());
|
2016-11-06 12:08:40 -06:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|