Sort documentation sections, fix json parse error for keybindings and add detailed documentation to html output

This commit is contained in:
Emil Axelsson
2016-10-27 17:09:56 +02:00
parent 22847655be
commit 73e6fcf865
9 changed files with 38 additions and 5 deletions

View File

@@ -30,6 +30,18 @@
background-color: #fff;
}
.documentation-item.remote-scripting {
border-left: 2px solid #4c1315;
background-color: #fcdcdc;
color: #4c1315;
}
.documentation-item.local-scripting {
border-left: 2px solid #2d4256;
background-color: #dcf1f9;
color: #2d4256;
}
.documentation-type {
color: #888;
font-size: 0.8em;

View File

@@ -11,7 +11,8 @@
{{/if}}
</a>
</p>
<p class="documentation-description">{{description}}</p>
<p class="documentation-type">{{description}}</p>
<p class="documentation-description">{{documentation}}</p>
{{#with restrictions}}
{{>documentation}}
{{/with}}

View File

@@ -18,6 +18,10 @@ window.onload = function () {
return identifier;
});
documentation.sort(function (a, b) {
return a.name < b.name ? -1 : (a.name > b.name ? 1 : 0);
});
var data = {
documentation: documentation,
version: version

View File

@@ -18,6 +18,10 @@ window.onload = function () {
return identifier;
});
factories.sort(function (a, b) {
return a.name < b.name ? -1 : (a.name > b.name ? 1 : 0);
});
var data = {
factories: factories,
version: version

View File

@@ -1,9 +1,9 @@
<div class="documentation-item">
<div class="documentation-item {{#if remoteScripting}}remote-scripting{{else}}local-scripting{{/if}}">
<div class="row">
<div class="col-lg-12">
<p>
<a href="#{{urlify key}}" name="{{urlify key}}">
<span class="documentation-key">{{key}}</span>
<span class="documentation-key">{{key}}</span> <span class="documentation-type">{{#if remoteScripting}}Remote scripting{{else}}Local scripting{{/if}}</span>
</a>
<p>{{script}}</p>
</p>

View File

@@ -18,6 +18,10 @@ window.onload = function () {
return identifier;
});
keybindings.sort(function (a, b) {
return a.key < b.key ? -1 : (a.key > b.key ? 1 : 0);
});
var data = {
keybindings: keybindings,
version: version,

View File

@@ -18,6 +18,10 @@ window.onload = function () {
return identifier;
});
scripting.sort(function (a, b) {
return a.library < b.library ? -1 : (a.library > b.library ? 1 : 0);
});
var data = {
scripting: scripting,
version: version

View File

@@ -46,6 +46,10 @@ window.onload = function () {
return identifier;
});
propertyOwners.sort(function (a, b) {
return a.name < b.name ? -1 : (a.name > b.name ? 1 : 0);
});
var data = {
propertyOwners: propertyOwners,
version: version,

View File

@@ -469,8 +469,8 @@ void InteractionHandler::writeKeyboardDocumentation(const std::string& type, con
first = false;
json << "{";
json << "\"key\": \"" << std::to_string(p.first) << "\",";
json << "\"script\": \"" << p.second.first << "\"";
json << "\"remoteScripting\": \"" << (p.second.second ? "true" : "false") << "\"";
json << "\"script\": \"" << p.second.first << "\",";
json << "\"remoteScripting\": " << (p.second.second ? "true" : "false");
json << "}";
}
json << "]";