Skip to content

Commit ae68951

Browse files
committed
update help
1 parent 73142ce commit ae68951

File tree

7 files changed

+59
-4
lines changed

7 files changed

+59
-4
lines changed

WebPageProcessor/webPageProcessor.py

+26
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,11 @@ def createWebPage(self, pageID, isMobile, args):
574574
pageParts = pageID.split("/")
575575
if len(pageParts) > 1:
576576
# help page
577+
print(pageParts)
577578
helpIndex = self.getPage("/docs/assets/helpPages.md")
578579
helpPage = self.getPage("/docs/"+pageID)
579580
if isMobile:
581+
helpIndex = self.createLinks(pageParts)
580582
page = render_template(
581583
"help_mobile.html",
582584
title="Help",
@@ -626,6 +628,30 @@ def getPage(self, pageName):
626628
filteredPage = filteredPage.replace("Â", "")
627629
filteredPage = filteredPage.replace("{: .label .label-blue }", "")
628630
filteredPage = filteredPage.replace("<a href=\"http", "<a target='_blank' href=\"http")
631+
filteredPage = filteredPage.replace("<table>", "<table class='table'>")
629632

630633
return filteredPage
631634

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

docs/Actions/DiagnosticsMaintenance/testMotorsEncoders.md renamed to docs/Actions/Diagnostics Maintenance/testMotorsEncoders.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ parent: Diagnostics/Maintenance
66
grand_parent: Actions
77
---
88
# Test Motors/Encoders
9+
10+
Release: >0.906
11+
{: .label .label-blue }
912

13+
1014
### Description
1115
This function sends a test command to the controller to exercise the motors and read values from the encoders.
1216

@@ -40,5 +44,3 @@ For each motor, the following actions are taken (based upon current stock firmwa
4044
|One or More Motors Fail One Direction |Possible hardware issue with motor or encoder |
4145

4246

43-
Release: >0.906
44-
{: .label .label-blue }

docs/assets/actions/diagnosticsMaintenance/index.md renamed to docs/assets/actions/Diagnostics Maintenance/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Release: >0.906
66

77
###### TABLE OF CONTENTS
88

9-
[Test Motors/Encoders](Actions/DiagnosticsMaintenance/testMotorsEncoders.md)
9+
[Test Motors/Encoders](Actions/Diagnostics Maintenance/testMotorsEncoders.md)
1010

1111

1212

docs/assets/actions/index.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
# Actions
3+
4+
Release: >0.906
5+
{: .label .label-blue }
6+
7+
###### TABLE OF CONTENTS
8+
9+
[Diagnostics / Maintenance](assets/actions/Diagnostics Maintenance/index.md)
10+
11+
[Calibration / Setup](assets/actions/calibrationSetup/index.md)
12+
13+
[Controller](assets/actions/controller/index.md)
14+
15+
16+
17+
18+
19+
20+

docs/assets/helpPages.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
###### Actions
1717

18-
[Diagnostics/Maintenance](assets/actions/diagnosticsMaintenance/index.md)
18+
[Diagnostics/Maintenance](assets/actions/Diagnostics Maintenance/index.md)
1919

2020
[Calibration/Setup](assets/actions/calibrationSetup/index.md)
2121

templates/help_mobile.html

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% block content %}
2+
<div class="container-fluid">
3+
<input id="pageID" type="hidden" value="{{pageID}}">
4+
{{helpIndex|safe}}
5+
{{helpPage|safe}}
6+
</div>
7+
{% endblock %}

0 commit comments

Comments
 (0)