Browse Source

start work on docs

Thomas Buck 7 months ago
parent
commit
c8cc0a76d0

+ 4
- 0
.gitignore View File

@@ -7,3 +7,7 @@ pcb/drumkit-backups
7 7
 pcb/plot
8 8
 pcb/fabrication
9 9
 pcb/fab.zip
10
+
11
+docs/book
12
+docs/src/plot
13
+docs/src/inc_*.md

+ 3
- 0
.gitmodules View File

@@ -4,3 +4,6 @@
4 4
 [submodule "pico-ssd1306"]
5 5
 	path = pico-ssd1306
6 6
 	url = https://github.com/daschr/pico-ssd1306
7
+[submodule "docs/svg-pan-zoom"]
8
+	path = docs/svg-pan-zoom
9
+	url = https://github.com/WebSVG/svg-pan-zoom

+ 40
- 0
docs/book.toml View File

@@ -0,0 +1,40 @@
1
+# SPDX-FileCopyrightText: 2024 Thomas Buck <thomas@xythobuz.de>
2
+# SPDX-License-Identifier: CERN-OHL-S-2.0+
3
+#
4
+#  ------------------------------------------------------------------------------
5
+# | Copyright (c) 2024 Thomas Buck <thomas@xythobuz.de>                          |
6
+# |                                                                              |
7
+# | This source describes Open Hardware and is licensed under the CERN-OHL-S v2  |
8
+# | or any later version.                                                        |
9
+# |                                                                              |
10
+# | You may redistribute and modify this source and make products using it under |
11
+# | the terms of the CERN-OHL-S v2 (https://ohwr.org/cern_ohl_s_v2.txt)          |
12
+# | or any later version.                                                        |
13
+# |                                                                              |
14
+# | This source is distributed WITHOUT ANY EXPRESS OR IMPLIED WARRANTY,          |
15
+# | INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS FOR A         |
16
+# | PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 (or any later version)      |
17
+# | for applicable conditions.                                                   |
18
+# |                                                                              |
19
+# | Source location: https://git.xythobuz.de/thomas/drumkit                      |
20
+# |                                                                              |
21
+# | As per CERN-OHL-S v2 section 4, should You produce hardware based on this    |
22
+# | source, You must where practicable maintain the Source Location visible      |
23
+# | on the external case of the Gizmo or other products you make using this      |
24
+# | source.                                                                      |
25
+#  ------------------------------------------------------------------------------
26
+
27
+[book]
28
+title = "LARS - Looping Automated Rhythm Station"
29
+authors = ["kauzerei", "xythobuz"]
30
+description = "Documentation for LARS, a Raspberry Pi Pico based drum machine."
31
+language = "en"
32
+multilingual = false
33
+src = "src"
34
+
35
+[output.html]
36
+default-theme = "rust"
37
+preferred-dark-theme = "ayu"
38
+git-repository-url = "https://github.com/xythobuz/lars"
39
+edit-url-template = "https://github.com/xythobuz/lars/edit/master/docs/{path}"
40
+site-url = "/lars/"

+ 77
- 0
docs/generate_docs.sh View File

@@ -0,0 +1,77 @@
1
+#!/bin/bash
2
+
3
+# SPDX-FileCopyrightText: 2024 Thomas Buck <thomas@xythobuz.de>
4
+# SPDX-License-Identifier: CERN-OHL-S-2.0+
5
+#
6
+#  ------------------------------------------------------------------------------
7
+# | Copyright (c) 2024 Thomas Buck <thomas@xythobuz.de>                          |
8
+# |                                                                              |
9
+# | This source describes Open Hardware and is licensed under the CERN-OHL-S v2  |
10
+# | or any later version.                                                        |
11
+# |                                                                              |
12
+# | You may redistribute and modify this source and make products using it under |
13
+# | the terms of the CERN-OHL-S v2 (https://ohwr.org/cern_ohl_s_v2.txt)          |
14
+# | or any later version.                                                        |
15
+# |                                                                              |
16
+# | This source is distributed WITHOUT ANY EXPRESS OR IMPLIED WARRANTY,          |
17
+# | INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS FOR A         |
18
+# | PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 (or any later version)      |
19
+# | for applicable conditions.                                                   |
20
+# |                                                                              |
21
+# | Source location: https://git.xythobuz.de/thomas/drumkit                      |
22
+# |                                                                              |
23
+# | As per CERN-OHL-S v2 section 4, should You produce hardware based on this    |
24
+# | source, You must where practicable maintain the Source Location visible      |
25
+# | on the external case of the Gizmo or other products you make using this      |
26
+# | source.                                                                      |
27
+#  ------------------------------------------------------------------------------
28
+
29
+INSCH="drumkit.kicad_sch"
30
+INPCB="drumkit.kicad_pcb"
31
+
32
+cd "$(dirname "$0")"
33
+
34
+echo "Generating plots"
35
+rm -rf src/plot
36
+../pcb/generate_plot.sh
37
+cp -r ../pcb/plot src
38
+echo
39
+
40
+for IN in $INSCH
41
+do
42
+    o="src/inc_$IN.md"
43
+    echo "Include for $IN at $o"
44
+
45
+    rm -rf $o
46
+    echo "<script src=\"js/svg-pan-zoom.js\" charset=\"UTF-8\"></script>" >> $o
47
+
48
+    for f in `ls src/plot/$IN.svg/*.svg | sort -r`; do
49
+        file=`echo $f | sed 's:src/:./:g'`
50
+        name=`echo $f | sed "s:src/plot/$IN.svg/::g" | sed 's:.svg::g'`
51
+        echo "Sheet at $name"
52
+
53
+        echo "<h2>$name</h2>" >> $o
54
+        echo "<div style=\"background-color: white; border: 1px solid black;\">" >> $o
55
+        echo "<embed type=\"image/svg+xml\" src=\"$file\" id=\"pz_$name\" style=\"width:100%;\"/>" >> $o
56
+        echo "<script>" >> $o
57
+        echo "document.getElementById('pz_$name').addEventListener('load', function(){" >> $o
58
+        echo "svgPanZoom(document.getElementById('pz_$name'), {controlIconsEnabled: true, minZoom: 1.0});" >> $o
59
+        echo "})" >> $o
60
+        echo "</script>" >> $o
61
+        echo "</div>" >> $o
62
+        echo >> $o
63
+        echo "[Direct link to \`$name\`]($file)." >> $o
64
+        echo >> $o
65
+    done
66
+
67
+    echo
68
+done
69
+
70
+echo "Generating docs"
71
+if [ "$1" = "serve" ] ; then
72
+    mdbook serve --open
73
+elif [ "$1" = "build" ] ; then
74
+    mdbook build
75
+else
76
+    echo "Invalid command. 'build' or 'serve'."
77
+fi

+ 11
- 0
docs/src/SUMMARY.md View File

@@ -0,0 +1,11 @@
1
+# Summary
2
+
3
+# LARS
4
+
5
+- [Introduction](./introduction.md)
6
+
7
+# Hardware
8
+
9
+- [Prototype](./pcb1.md)
10
+  - [Schematics](./pcb1_sch.md)
11
+  - [PCB Layout](./pcb1_pcb.md)

+ 5
- 0
docs/src/introduction.md View File

@@ -0,0 +1,5 @@
1
+# Introduction
2
+
3
+**TODO** work in progress
4
+
5
+

+ 1
- 0
docs/src/js/svg-pan-zoom.js View File

@@ -0,0 +1 @@
1
+../../svg-pan-zoom/dist/svg-pan-zoom.js

+ 1
- 0
docs/src/js/svg-pan-zoom.min.js View File

@@ -0,0 +1 @@
1
+../../svg-pan-zoom/dist/svg-pan-zoom.min.js

+ 4
- 0
docs/src/pcb1.md View File

@@ -0,0 +1,4 @@
1
+# Prototype
2
+
3
+This is the hardware design for the initial prototype gifted as a birthday present.
4
+It's a single sided PCB layout suitable for hand etching at home.

+ 35
- 0
docs/src/pcb1_pcb.md View File

@@ -0,0 +1,35 @@
1
+# Prototype PCB Layout
2
+
3
+This page shows the current version of the PCB layout as SVG graphics.
4
+
5
+## 2D PCB Layout
6
+
7
+You can also view the [2D PCB layout as PDF](./plot/drumkit.kicad_pcb.pdf).
8
+
9
+<script src="js/svg-pan-zoom.js" charset="UTF-8"></script>
10
+<div style="background-color: white; border: 1px solid black;">
11
+    <embed type="image/svg+xml" src="./plot/drumkit.kicad_pcb.svg" id="pz_drumkit0" style="width: 100%;"/>
12
+    <script>
13
+        document.getElementById('pz_drumkit0').addEventListener('load', function(){
14
+            svgPanZoom(document.getElementById('pz_drumkit0'), {controlIconsEnabled: true, minZoom: 1.0});
15
+        })
16
+    </script>
17
+</div>
18
+
19
+[Direct link to this file](./plot/drumkit.kicad_pcb.svg).
20
+
21
+## DIY Version
22
+
23
+You can also view the [DIY layout as PDF](./plot/drumkit.kicad_pcb_diy.pdf).
24
+
25
+<script src="js/svg-pan-zoom.js" charset="UTF-8"></script>
26
+<div style="background-color: white; border: 1px solid black;">
27
+    <embed type="image/svg+xml" src="./plot/drumkit.kicad_pcb_diy.svg" id="pz_drumkit1" style="width: 100%;"/>
28
+    <script>
29
+        document.getElementById('pz_drumkit1').addEventListener('load', function(){
30
+            svgPanZoom(document.getElementById('pz_drumkit1'), {controlIconsEnabled: true, minZoom: 1.0});
31
+        })
32
+    </script>
33
+</div>
34
+
35
+[Direct link to this file](./plot/drumkit.kicad_pcb_diy.svg).

+ 7
- 0
docs/src/pcb1_sch.md View File

@@ -0,0 +1,7 @@
1
+# Prototype Schematics
2
+
3
+This page shows the current version of the schematics as SVG graphics.
4
+
5
+You can also view the [schematics as PDF](./plot/drumkit.kicad_sch.pdf).
6
+
7
+{{#include inc_drumkit.kicad_sch.md}}

+ 1
- 0
docs/svg-pan-zoom

@@ -0,0 +1 @@
1
+Subproject commit d9b9a55ef386c6fb04a82881ee233642d61e99cf

Loading…
Cancel
Save