Added banner to warn users about the latest version of docs only referring to development branch

This commit is contained in:
corkyw10 2021-05-10 16:31:12 +02:00 committed by bernat
parent d05d1f5e37
commit ffb539edeb
3 changed files with 26 additions and 0 deletions

View File

@ -244,3 +244,18 @@ table tbody td{
top: 70px;
left: 1100px;
}
/************************* LATEST WARNING BANNER **************************/
.dev-version-warning {
padding-top: 15px;
padding-bottom: 15px;
padding-left: 15px;
padding-right: 15px;
margin-bottom: 8px;
color: #404040;
font-weight: bold;
background-color: #f55c47;
text-align: center;
border-radius: 5px;
}

10
Docs/extra.js Normal file
View File

@ -0,0 +1,10 @@
$(document).ready(function () {
if(window.location.href.indexOf("latest") != -1) {
var banner = document.createElement("div");
banner.className = "dev-version-warning";
banner.innerHTML = "You are currently reading documentation for the \"dev\" branch of CARLA. This documentation refers to features currently in development and may result in unexpected behaviour. To read documentation for previous releases, select the desired version in the bottom, right-hand corner of the screen.";
var x = document.getElementsByClassName("section");
console.log(x)
x[0].insertBefore(banner,x[0].childNodes[0]);
}
});

View File

@ -4,6 +4,7 @@ docs_dir: Docs
edit_uri: 'edit/master/Docs/'
theme: readthedocs
extra_css: [extra.css]
extra_javascript: [extra.js]
nav:
- Home: 'index.md'