mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 19:19:39 -06:00
improve look and feel for lua scripting docs
This commit is contained in:
28
data/web/luascripting/script.js
Normal file
28
data/web/luascripting/script.js
Normal file
@@ -0,0 +1,28 @@
|
||||
window.onload = function () {
|
||||
var mainTemplateElement = document.getElementById('mainTemplate');
|
||||
var mainTemplate = Handlebars.compile(mainTemplateElement.innerHTML);
|
||||
|
||||
var scriptingTemplateElement = document.getElementById('scriptingTemplate');
|
||||
Handlebars.registerPartial('scripting', scriptingTemplateElement.innerHTML);
|
||||
|
||||
Handlebars.registerHelper('urlify', function(options, context) {
|
||||
var data = context.data;
|
||||
var identifier = options.replace(" ", "-").toLowerCase();
|
||||
|
||||
while (data = data._parent) {
|
||||
if (data.key !== undefined) {
|
||||
identifier = data.key + "-" + identifier;
|
||||
}
|
||||
}
|
||||
|
||||
return identifier;
|
||||
});
|
||||
|
||||
var data = {
|
||||
scripting: scripting,
|
||||
version: version
|
||||
}
|
||||
|
||||
var contents = mainTemplate(data);
|
||||
document.body.innerHTML = contents;
|
||||
}
|
||||
Reference in New Issue
Block a user