ifdef::backend-xhtml11[]
++++
- <div id="toggle"><img src="images\icons\toggle.png" title="click to toggle table of contents"></div>
- <div id="toc">
<div id="toctitle">
+ <img class="trex_logo" src="images\trex_logo_toc.png"/>
Table of Contents
</div>
+
+ <div id="toggle">
+ <img src="images\icons\toggle.png" title="click to toggle table of contents"/>
+ </div>
- <div id="nav-tree">
+
+ <div id="toc">
+ <div id="nav-tree">
+ </div>
</div>
- </div>
<!-- load the theme CSS file -->
#toc {
position: fixed;
- top: 0;
+ top: 51px;
left: 0;
bottom: 0;
width: 18em;
padding-bottom: 1.5em;
margin: 0;
- overflow-x: auto;
- overflow-y: hidden;
+ overflow-x: auto !important;
+ overflow-y: auto !important;
border-right: solid 2px #cfcfcf;
background-color: #FAFAFA;
white-space: nowrap;
background-color: #e4e2e2;
padding: 8px 0px 7px 45px;
white-space: nowrap;
+ left: 0px;
+ display: block;
+ position: fixed;
+ z-index: 100;
+ width: 245px;
+ top: 0px;
+ overflow: hidden;
}
#toc .toclevel1 {
text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
}
+ /* For side bar */
+ .ui-resizable-e{
+ height: 100%;
+ width: 4px !important;
+ position: fixed !important;
+ top: 0px !important;
+ cursor: e-resize !important;
+ background: url('images\splitbar.png') repeat scroll right center transparent !important;
+ background-image: url('images\splitbar.png');
+ }
+
+ .jstree-default .jstree-themeicon{
+ display: none !important;
+ }
+
+
.jstree-anchor {
font-size: 12px !important;
color: #91A501 !important;
}
- /* For side bar */
- .ui-resizable-e{
- width: 10px !important;
- }
.jstree-clicked{
color: green !important;
}
- .jstree-default .jstree-themeicon{
- display: none !important;
- }
#toggle {
position: fixed;
top: 14px;
left: 10px;
- z-index: 10;
+ z-index: 210;
+ width: 24px;
}
#toggle img {
opacity:0.9;
}
+ .trex_logo{
+ top: 6px;
+ position: relative;
+ }
+
</style>
initResizable();
// Toggle TOC whe clicking on the menu icon
toggleTOC();
+ // Handle Mobile - close TOC
+ checkMobile();
function initializeNavTree() {
- $('#nav-tree').jstree({
+
+ // TOC tree options
+ var toc_tree = $('#nav-tree');
+
+ var toc_tree_options = {
'core' : {
"animation" :false,
"themes" : { "stripes" : false },
}
,
"plugins" : [ "wholerow" ]
- });
+ };
+
+ $('#nav-tree').jstree(toc_tree_options)
$('#nav-tree').on("changed.jstree", function (e, data) {
window.location.href = data.instance.get_selected(true)[0].original.link;
}
function initResizable() {
- var toc = $("#toc");
- var bodyLeftMargin = $("body");
- $("#toc").resizable({
- resize: function(e, ui) {
- var tocWidth = $("#toc").outerWidth();
- bodyLeftMargin.css({"marginLeft":parseInt(tocWidth)+20+"px"});
- },
- handles: 'e'
- });
- }
+ var toc = $("#toc");
+ var body = $("body");
+
+ // On resize
+ $("#toc").resizable({
+ resize: function(e, ui) {
+ var tocWidth = $(toc).outerWidth();
+ body.css({"marginLeft":parseInt(tocWidth)+20+"px"});
+ $(".ui-resizable-e").css({"right":$(window).width()-parseInt(tocWidth)+"px"});
+ $("#toctitle").css({"width":parseInt(tocWidth)-45+"px"});
+ },
+ handles: 'e'
+ });
+
+ // Do it for the first time
+ var tocWidth = $(toc).outerWidth();
+ $(".ui-resizable-e").css({"right":$(window).width()-parseInt(tocWidth)+"px"});
+ $("#toctitle").css({"width":parseInt(tocWidth)-45+"px"});
+ }
function toggleTOC(){
var isOpen = true;
$( "#toggle" ).click(function() {
if ( isOpen ) {
// Close it
- $("#toc").hide("slide", 500);
- // Show the show/hide button
- $("#toggle").css("right", "-40px");
- // $("body").css("margin-left", "20px");
- $("body").animate({
- "margin-left": "50px"
- }, 500);
+ closTOC();
} else {
// Open it
- $("#toc").show("slide", 500);
- // Show the show/hide button
- $("#toggle").css("right", "15px");
- // $("body").css("margin-left", $(toc).outerWidth()+20+"px");
- $("body").animate({
- "margin-left": $(toc).outerWidth()+20+"px"
- }, 500);
+ openTOC();
}
+ // Toggle status
isOpen = !isOpen;
});
}
- }
- )
+
+ // Close TOC by default if it is mobile
+ function checkMobile(){
+ if(isMobileDevice()){
+ closTOC();
+ }
+ }
+
+ // Check it it it is running on mobile device
+ function isMobileDevice() {
+ if(
+ navigator.userAgent.match(/Android/i) ||
+ navigator.userAgent.match(/BlackBerry/i) ||
+ navigator.userAgent.match(/iPhone|iPad|iPod/i) ||
+ navigator.userAgent.match(/Opera Mini/i) ||
+ navigator.userAgent.match(/IEMobile/i) ||
+ navigator.userAgent.match(/iPhone|iPad|iPod/i)
+ )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ // Close TOC
+ function closTOC(){
+ $("#toc").hide("slide", 500);
+ $("#toctitle").hide("slide", 500);
+ $(".ui-resizable-e").hide("slide", 500);
+ // Show the show/hide button
+ $("#toggle").css("right", "-40px");
+ // Fil width
+ $("body").animate({"margin-left": "50px"}, 500);
+ }
+
+ // Open TOC
+ function openTOC(){
+ $("#toc").show("slide", 500);
+ $("#toctitle").show("slide", 500);
+ $(".ui-resizable-e").show("slide", 500);
+ // Show the show/hide button
+ $("#toggle").css("right", "15px");
+ // Minimize page width
+ $("body").animate({"margin-left": $(toc).outerWidth()+20+"px"}, 500);
+ }
+
+ });
</script>
++++
def convert_to_pdf(task):
input_file = task.outputs[0].abspath()
out_dir = task.outputs[0].parent.get_bld().abspath()
- os.system('a2x --no-xmllint -v -f pdf -d article %s -D %s ' %(task.inputs[0].abspath(),out_dir ) )
- return (0)
+ return os.system('a2x --no-xmllint -v -f pdf -d article %s -D %s ' %(task.inputs[0].abspath(),out_dir ) )
json_out_file = os.path.splitext(task.outputs[0].abspath())[0]+'.json'
tmp = os.path.splitext(task.outputs[0].abspath())[0]+'.tmp'
json_out_file_short = os.path.splitext(task.outputs[0].name)[0]+'.json'
-
- cmd='{0} -a stylesheet={1} -a icons=true -a docinfo -d book -a max-width=55em -o {2} {3}'.format(
+
+ cmd='{0} -a stylesheet={1} -a icons=true -a docinfo -d book -a max-width=55em -o {2} {3}'.format(
task.env['ASCIIDOC'],
task.inputs[1].abspath(),
tmp,
task.inputs[0].abspath());
- os.system( cmd )
+ res= os.system( cmd )
+ if res !=0 :
+ return (1)
create_toc_json(tmp,json_out_file)
toc_fixup_file(tmp,task.outputs[0].abspath(),json_out_file_short);
- os.system('rm {0}'.format(tmp));
+ return os.system('rm {0}'.format(tmp));
def convert_to_pdf_book(task):
input_file = task.outputs[0].abspath()
out_dir = task.outputs[0].parent.get_bld().abspath()
- os.system('a2x --no-xmllint -v -f pdf -d book %s -D %s ' %(task.inputs[0].abspath(),out_dir ) )
- return (0)
+ return os.system('a2x --no-xmllint -v -f pdf -d book %s -D %s ' %(task.inputs[0].abspath(),out_dir ) )
def ensure_dir(f):
source='trex_rpc_server_spec.asciidoc waf.css', target='trex_rpc_server_spec.html',scan=ascii_doc_scan);
-
bld(rule='${ASCIIDOC} -a stylesheet=${SRC[1].abspath()} -a icons=true -a toc2 -a max-width=55em -o ${TGT} ${SRC[0].abspath()}',
source='vm_doc.asciidoc waf.css', target='vm_doc.html', scan=ascii_doc_scan)
+def publish_both(bld):
+ publish(bld)
+ publish_ext(bld)