diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-12-08 17:40:04 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-12-08 17:40:35 +0100 |
commit | f1fcccfd71623904abf1fd583ca552d4a297fea4 (patch) | |
tree | 1c75535e3b98fa299f7dcce4d2ccb7f769750026 /site | |
parent | d756f0604a581cc161e16e5b92856619690abf70 (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')
-rw-r--r-- | site/static/js/docs.js | 13 | ||||
-rw-r--r-- | site/static/styles/scss/_sections.scss | 83 | ||||
-rw-r--r-- | site/static/styles/scss/webdocs.scss | 1 |
3 files changed, 97 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) { } + }); + }); + + }); diff --git a/site/static/styles/scss/_sections.scss b/site/static/styles/scss/_sections.scss new file mode 100644 index 0000000..889e12a --- /dev/null +++ b/site/static/styles/scss/_sections.scss @@ -0,0 +1,83 @@ + +/* section-note blocks */ + +div.section-note { + background: #FCF8E3 none repeat scroll 0% 0%; + color: #4e4e4e; + padding: 15px; + margin-bottom: 10px; + border-bottom: 5px solid #DDD; + border-color: #FAEBCC; + page-break-inside: avoid; +} +div.section-note table { + background: white; +} + +div.section-note p { + padding-bottom: 0; + margin-bottom: 0; +} + +/* section-warning blocks */ + +div.section-warning { + background: #FD9595 none repeat scroll 0% 0%; + color: #4e4e4e; + padding: 15px; + margin-bottom: 10px; + border-bottom: 5px solid #DDD; + border-color: #FF6B6B; + page-break-inside: avoid; +} + +div.section-warning table { + background: white; +} + +div.section-warning p { + padding-bottom: 0; + margin-bottom: 0; +} + +/* section-config blocks */ + +div.section-config { + background: #d2e2ee none repeat scroll 0% 0%; + color: #4e4e4e; + padding: 15px; + margin-bottom: 10px; + border-bottom: 5px solid #DDD; + border-color: #b5c5d1; + page-break-inside: avoid; +} + +div.section-config table { + background: white; +} + +div.section-config p { + padding-bottom: 0; + margin-bottom: 0; +} + +/* section-todo blocks */ + +div.section-todo { + background: #d3eed2 none repeat scroll 0% 0%; + color: #4e4e4e; + padding: 15px; + margin-bottom: 10px; + border-bottom: 5px solid #DDD; + border-color: #b1d5b0; + page-break-inside: avoid; +} + +div.section-todo table { + background: white; +} + +div.section-todo p { + padding-bottom: 0; + margin-bottom: 0; +} diff --git a/site/static/styles/scss/webdocs.scss b/site/static/styles/scss/webdocs.scss index ccd8572..ae3b6b0 100644 --- a/site/static/styles/scss/webdocs.scss +++ b/site/static/styles/scss/webdocs.scss @@ -242,3 +242,4 @@ code { @import '_contribute'; @import '_contact'; @import '_artwork'; +@import '_sections'; |