Browse Source

use menu helper for xyrobot

Thomas Buck 2 years ago
parent
commit
0c8cb1adc7

+ 2
- 12
input/stuff/xyrobot.md View File

18
 Other articles that are part of xyRobot:
18
 Other articles that are part of xyRobot:
19
 
19
 
20
 <!--%
20
 <!--%
21
-mpages = [p for p in pages if p.get("parent", "") == "xyrobot" and p.lang == "en"]
22
-mpages.sort(key=lambda p: int(p["position"]))
23
-for p in mpages:
24
-    print "  * **[%s](%s)**" % (p.title, p.url) # markdown list item
25
-    if p.get("description", "") != "":
26
-        print "<br><span class=\"listdesc\">" + p.get("description", "") + "</span>"
21
+printRobotMenuEnglish()
27
 %-->
22
 %-->
28
 
23
 
29
 Now some pictures:
24
 Now some pictures:
78
 
73
 
79
 lang: de
74
 lang: de
80
 
75
 
81
-### {{ page.title_de }}
82
-
83
 Dies ist mein kleines Roboterprojekt. Eine eigene Platine mit einem AtMega2560 steuert den Roboter. Angeschlossen sind unter anderem mein [Bluetooth Modul][1], eine [Gameboy Kamera][2] und mein [RAM Modul][3]. Vom [Roboternetz][4] stammen das [RN-KeyLCD][5] und der [RN-VN2 Motortreiber][6].
76
 Dies ist mein kleines Roboterprojekt. Eine eigene Platine mit einem AtMega2560 steuert den Roboter. Angeschlossen sind unter anderem mein [Bluetooth Modul][1], eine [Gameboy Kamera][2] und mein [RAM Modul][3]. Vom [Roboternetz][4] stammen das [RN-KeyLCD][5] und der [RN-VN2 Motortreiber][6].
84
 
77
 
85
 Die aktuelle Software sowie Eagle Dateien der Platine finden sich auf [GitHub][7].
78
 Die aktuelle Software sowie Eagle Dateien der Platine finden sich auf [GitHub][7].
87
 Andere Artikel die zu xyRobot gehören:
80
 Andere Artikel die zu xyRobot gehören:
88
 
81
 
89
 <!--%
82
 <!--%
90
-mpages = [p for p in pages if p.get("parent", "") == "xyrobot" and p.lang == "de"]
91
-mpages.sort(key=lambda p: int(p["position"]))
92
-for p in mpages:
93
-    print "  * **[%s](%s)**" % (p.title, p.url) # markdown list item
83
+printRobotMenuDeutsch()
94
 %-->
84
 %-->
95
 
85
 
96
 Hier nun einige Bilder meines Roboters:
86
 Hier nun einige Bilder meines Roboters:

+ 1
- 0
input/stuff/xyrobot/bluetooth.md View File

1
 title: Bluetooth UART (BTM-222)
1
 title: Bluetooth UART (BTM-222)
2
 title_de: Bluetooth UART (BTM-222)
2
 title_de: Bluetooth UART (BTM-222)
3
 description: PCB for the BTM-222 and 5V level converters
3
 description: PCB for the BTM-222 and 5V level converters
4
+description_de: Platine fuer BTM-222 und 5V Pegelwandler
4
 parent: xyrobot
5
 parent: xyrobot
5
 position: 0
6
 position: 0
6
 comments: true
7
 comments: true

+ 1
- 0
input/stuff/xyrobot/k6x4008.md View File

1
 title: K6x4008 SRAM
1
 title: K6x4008 SRAM
2
 title_de: K6x4008 SRAM
2
 title_de: K6x4008 SRAM
3
 description: Connecting an K6x4008 SRAM to an ATmega2560
3
 description: Connecting an K6x4008 SRAM to an ATmega2560
4
+description_de: K6x4008 SRAM an ATmega2560 verwenden
4
 parent: xyrobot
5
 parent: xyrobot
5
 position: 1
6
 position: 1
6
 comments: true
7
 comments: true

+ 1
- 0
input/stuff/xyrobot/rremote.md View File

1
 title: rRemote
1
 title: rRemote
2
 title_de: rRemote
2
 title_de: rRemote
3
 description: Remote Control Casio FX9860-GII Calculator AddIn
3
 description: Remote Control Casio FX9860-GII Calculator AddIn
4
+description_de: Remote Control Casio FX9860-GII Taschenrechner AddIn
4
 parent: xyrobot
5
 parent: xyrobot
5
 position: 2
6
 position: 2
6
 comments: true
7
 comments: true

+ 1
- 0
input/stuff/xyrobot/xyrobotremote.md View File

1
 title: xyRobotRemote
1
 title: xyRobotRemote
2
 title_de: xyRobotRemote
2
 title_de: xyRobotRemote
3
 description: Java Swing App to remote-control a robot
3
 description: Java Swing App to remote-control a robot
4
+description: Java Swing App um einen Roboter fernzusteuern
4
 parent: xyrobot
5
 parent: xyrobot
5
 position: 3
6
 position: 3
6
 comments: true
7
 comments: true

+ 13
- 0
macros.py View File

95
     mpages.sort(key=lambda p: int(p["position"]))
95
     mpages.sort(key=lambda p: int(p["position"]))
96
     for p in mpages:
96
     for p in mpages:
97
         printMenuItem(p, False, True, True)
97
         printMenuItem(p, False, True, True)
98
+
99
+def printRobotMenuEnglish():
100
+    mpages = [p for p in pages if p.get("parent", "") == "xyrobot" and p.lang == "en"]
101
+    mpages.sort(key=lambda p: int(p["position"]))
102
+    for p in mpages:
103
+        printMenuItem(p)
104
+
105
+def printRobotMenuDeutsch():
106
+    mpages = [p for p in pages if p.get("parent", "") == "xyrobot" and p.lang == "de"]
107
+    mpages.sort(key=lambda p: int(p["position"]))
108
+    for p in mpages:
109
+        printMenuItem(p, False, False, False, False, "0", "de")
110
+
98
 # -----------------------------------------------------------------------------
111
 # -----------------------------------------------------------------------------
99
 # lightgallery helper macro
112
 # lightgallery helper macro
100
 # -----------------------------------------------------------------------------
113
 # -----------------------------------------------------------------------------

Loading…
Cancel
Save