aboutsummaryrefslogtreecommitdiffstats
path: root/site/static/js
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-08 17:40:04 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-08 17:40:35 +0100
commitf1fcccfd71623904abf1fd583ca552d4a297fea4 (patch)
tree1c75535e3b98fa299f7dcce4d2ccb7f769750026 /site/static/js
parentd756f0604a581cc161e16e5b92856619690abf70 (diff)
Added templating for section-xxx tags.
Security Blueprint doc uses specific tags to display arrays (see docs/security-blueprint/README.md) Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'site/static/js')
-rw-r--r--site/static/js/docs.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/site/static/js/docs.js b/site/static/js/docs.js
index 1309525..9247cd3 100644
--- a/site/static/js/docs.js
+++ b/site/static/js/docs.js
@@ -139,4 +139,17 @@ $(document).ready(function () {
element.innerText = '';
}
});
+
+ $('#page-toc-source').each(function(index, element) {
+ // Process section-xxx (eg. section-note or section-config) in order
+ // to apply right style (see webdocs-agl/site/static/styles/scss/_sections.scss )
+ ['section-note', 'section-config', 'section-warning', 'section-todo'].forEach(function (sec) {
+ try {
+ res = element.innerHTML.replace(new RegExp('<!--[ ]*end-' + sec + '[ ]*-->', 'g'), '</div>');
+ element.innerHTML = res.replace(new RegExp('<!--[ ]*' + sec + '[ ]*-->', 'g'), '<div class="' + sec +'">');
+ } catch(err) { }
+ });
+ });
+
+
});