Skip to content

Instantly share code, notes, and snippets.

@eob
Created October 1, 2013 17:00
Show Gist options
  • Save eob/6781702 to your computer and use it in GitHub Desktop.
Save eob/6781702 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CTS Example: Loading HTML" />
<title>CTS Example: Loading HTML</title>
<script src="http://treesheets.org/cts.js"></script>
<style type="text/cts">
@html theme http://treesheets.csail.mit.edu/mockups/blog/twenty-thirteen/index.html;
</style>
</head>
<body style="padding: 20px">
Here is the contents of the <code>theme</code> tree loaded by CTS:
<br />
<textarea rows=10 cols=80>
</textarea>
<script>
// Note: as a CTS user you will never have to delve into the guts of the
// engine like this. This is just an example to show you that the HTML
// tree referenced in the Treesheet above is actually being loaded and
// incorporated into the "Forrest" of trees that CTS maintains.
CTS.ready.then(function() {
CTS.engine._booted.promise.then(function() {
CTS.$('textarea').html(CTS.engine.forrest.trees.theme.root.value.html());
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment