Ver código fonte

use menu helper for xyrobot

Thomas Buck 3 anos atrás
pai
commit
0c8cb1adc7

+ 2
- 12
input/stuff/xyrobot.md Ver arquivo

@@ -18,12 +18,7 @@ The current software as well as Eagle files of the PCB are on [GitHub][7].
18 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 24
 Now some pictures:
@@ -78,8 +73,6 @@ Now some pictures:
78 73
 
79 74
 lang: de
80 75
 
81
-### {{ page.title_de }}
82
-
83 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 78
 Die aktuelle Software sowie Eagle Dateien der Platine finden sich auf [GitHub][7].
@@ -87,10 +80,7 @@ Die aktuelle Software sowie Eagle Dateien der Platine finden sich auf [GitHub][7
87 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 86
 Hier nun einige Bilder meines Roboters:

+ 1
- 0
input/stuff/xyrobot/bluetooth.md Ver arquivo

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

+ 1
- 0
input/stuff/xyrobot/k6x4008.md Ver arquivo

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

+ 1
- 0
input/stuff/xyrobot/rremote.md Ver arquivo

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

+ 1
- 0
input/stuff/xyrobot/xyrobotremote.md Ver arquivo

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

+ 13
- 0
macros.py Ver arquivo

@@ -95,6 +95,19 @@ def printQuadcopterMenu():
95 95
     mpages.sort(key=lambda p: int(p["position"]))
96 96
     for p in mpages:
97 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 112
 # lightgallery helper macro
100 113
 # -----------------------------------------------------------------------------

Carregando…
Cancelar
Salvar