This is a JSON dump of the D3 gallery as a first step for its complete redesign. It also shows a minimalist templating system.
xxxxxxxxxx
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/d3@2.10.3/d3.v2.js"></script>
<style type="text/css">
a.link{color: grey;}
a.link:hover{color: black;}
div.gallery{width:800px; height:500px; overflow:scroll}
</style>
</head>
<body>
<script id="template" type="text/template">
<a class="link" href="{url}">{title}</a>
</script>
<div class="gallery"></div>
<script type="text/javascript">
var tmpl = d3.select("#template").text();
d3.json("gallery.json", function(json){
d3.select(".gallery")
.selectAll("div.entry")
.data(json)
.enter().append("div")
.attr("class", "entry")
.html(function(d, i){
var entry = {title: d[0], url: d[1]};
return tmpl.replace(/{([^}]*)}/g, function(s, key){return entry[key];});
});
});
</script>
</body>
</html>
Modified http://mbostock.github.com/d3/d3.js to a secure url
https://mbostock.github.com/d3/d3.js