Skip to content

Instantly share code, notes, and snippets.

@benyanke
Created April 6, 2017 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benyanke/c576d8c7275e8db85737ce0d249a75f3 to your computer and use it in GitHub Desktop.
Save benyanke/c576d8c7275e8db85737ce0d249a75f3 to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<link rel="stylesheet" href="css/styles.css?v=1.0">
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<script src="https://ex.surge.sh/exsurge.js"></script>
<script>
var ctxt = new exsurge.ChantContext();
var gabc = "(f3) EC(ce!fg)CE(f) *(,) ad(fe~)vé(f!gwhf)nit(f) (,)"
var score = exsurge.Gabc.loadChantScore(ctxt, gabc, true);
// perform layout on the chant
score.performLayout(ctxt, function() {
score.layoutChantLines(ctxt, 1000, function() {
// render the score to svg code
var svgNode = document.createElement('div');
var innerHtml = score.createDrawable(ctxt);
svgNode.innerHTML = innerHtml;
document.body.appendChild(svgNode);
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment