
Currently for both upstream-training and training-guide directory slides are stored in the subdirectories of landing web pages. It is not easy to capture the directory structure and this requires Sphinx conf file to have unnecessary excluded entries. This commits reorganizes each directory to the following structure. It follows the convention in the documentation project. doc/upstream-training: (previous) +-- README.rst +-- website RST files +-- conf.py (for website) +-- build/ +-- source/ +-- slide RST files +-- conf.py (for slides) +-- _assets/ +-- _static/ +-- locale/ (new) +-- README.rst +-- build/ +-- source/ +-- website/ | +-- website RST files | +-- conf.py (for website) | +-- _assets/ +-- slides/ | +-- slide RST files | +-- conf.py (for slides) | +-- _assets/ | +-- _static/ +-- locales/ training-guide directory is reorganized similarly. training-guide _assets/README has been removed as it is used. Also updates tox.ini to share target command definitions. We do not need to have same things in many places. Note that this commit does not change the build document paths. Change-Id: I5a21f170c06d8f71f1f2d0df354e6d6280cb29d0
51 lines
1.9 KiB
JavaScript
51 lines
1.9 KiB
JavaScript
function logABug() {
|
|
var lineFeed = "%0A";
|
|
|
|
// generate title
|
|
var headings = document.getElementsByTagName('h2');
|
|
var bugTitle;
|
|
if (headings.length > 0) {
|
|
bugTitle = headings[headings.length-1].innerHTML
|
|
+ " in Upstream Training";
|
|
} else {
|
|
bugTitle = document.title + " in Upstream Training";
|
|
}
|
|
// remove unnecessary anchor tag
|
|
bugTitle = bugTitle.replace(/<a [^>]*>/, '');
|
|
bugTitle = bugTitle.replace(/<\/a>/, '');
|
|
|
|
// generate location with page number
|
|
var location = window.location.href;
|
|
if (location.indexOf("#") > 0) {
|
|
// remove static page number at the point direct access
|
|
location = location.substring(0,location.indexOf("#"));
|
|
}
|
|
var pageNum = headings.length + 1;
|
|
|
|
// generate bug report link URL
|
|
var bugLink = "https://bugs.launchpad.net/openstack-training-guides/"
|
|
+ "+filebug?field.title=" + encodeURIComponent(bugTitle)
|
|
+ "&field.comment=" + lineFeed + lineFeed
|
|
+ "----------------------------------------" + lineFeed
|
|
+ "Title: " + encodeURIComponent(bugTitle) + lineFeed
|
|
+ "URL: " + encodeURIComponent(location + "#" + pageNum);
|
|
|
|
// generate bug report link
|
|
var elementI = document.createElement('i');
|
|
var attrC1 = document.createAttribute('class');
|
|
attrC1.value = 'fa fa-bug';
|
|
elementI.setAttributeNode(attrC1);
|
|
|
|
var elementA = document.createElement('a');
|
|
var attrC2 = document.createAttribute('class');
|
|
var attrH = document.createAttribute('href');
|
|
attrC2.value = 'logabug';
|
|
attrH.value = bugLink;
|
|
elementA.setAttributeNode(attrC2);
|
|
elementA.setAttributeNode(attrH);
|
|
elementA.appendChild(elementI);
|
|
|
|
var slides = document.getElementsByTagName('article');
|
|
slides[slides.length-1].appendChild(elementA);
|
|
}
|