@@ -574,9 +574,11 @@ def createWebPage(self, pageID, isMobile, args):
574
574
pageParts = pageID .split ("/" )
575
575
if len (pageParts ) > 1 :
576
576
# help page
577
+ print (pageParts )
577
578
helpIndex = self .getPage ("/docs/assets/helpPages.md" )
578
579
helpPage = self .getPage ("/docs/" + pageID )
579
580
if isMobile :
581
+ helpIndex = self .createLinks (pageParts )
580
582
page = render_template (
581
583
"help_mobile.html" ,
582
584
title = "Help" ,
@@ -626,6 +628,30 @@ def getPage(self, pageName):
626
628
filteredPage = filteredPage .replace ("Â" , "" )
627
629
filteredPage = filteredPage .replace ("{: .label .label-blue }" , "" )
628
630
filteredPage = filteredPage .replace ("<a href=\" http" , "<a target='_blank' href=\" http" )
631
+ filteredPage = filteredPage .replace ("<table>" , "<table class='table'>" )
629
632
630
633
return filteredPage
631
634
635
+ def createLinks (self , pageParts ):
636
+ link = "<a href='#' onclick='requestPage(\" help\" );'>Home</a>"
637
+ #assets/actions/Diagnostics Maintenance/index.md
638
+ if len (pageParts ) == 4 and pageParts [3 ]== 'index.md' :
639
+ # third level index with form like:
640
+ # ['assets', 'actions', 'Diagnostics Maintenance', 'index.md']
641
+ forward = "assets/" + pageParts [1 ] + "/"
642
+ pageLink = " / <a href='#' onclick='requestPage(\" " + forward + pageParts [3 ]+ "\" );'>" + pageParts [1 ]+ "</a>"
643
+ link = link + pageLink
644
+ return link
645
+ if len (pageParts ) == 3 and pageParts [2 ].endswith (".md" ) and pageParts [2 ] != "index.md" :
646
+ # fourth level index with form like:
647
+ # ['Actions', 'Diagnostics Maintenance', 'testMotorsEncoders.md']
648
+ forward = "assets/" + pageParts [0 ]+ "/" + pageParts [1 ] + "/index.md"
649
+ pageLink = " / <a href='#' onclick='requestPage(\" " + forward + "\" );'>" + pageParts [1 ]+ "</a>"
650
+ link = link + pageLink
651
+ return link
652
+ if len (pageParts ) == 3 and pageParts [2 ].endswith (".md" ) and pageParts [2 ] == "index.md" :
653
+ # second level index with form like:
654
+ # ['assets', 'actions', 'index.md']
655
+ return link
656
+
657
+ return link
0 commit comments