Skip to content

Commit a0f8138

Browse files
committed
[docs] Generate references for targets and configs
1 parent d64f4ef commit a0f8138

File tree

14 files changed

+334
-125
lines changed

14 files changed

+334
-125
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ jobs:
1414
steps:
1515
- name: Check out repository
1616
uses: actions/checkout@v2
17-
- name: Update submodules and install lbuild
17+
- name: Update submodules and update modm tools
1818
run: |
19-
(git submodule sync && git submodule update --init --jobs 8) & pip3 install -U lbuild & wait
19+
(git submodule sync && git submodule update --init --jobs 8) & pip3 install --upgrade --upgrade-strategy=eager modm mkdocs mkdocs-material & wait
20+
mkdocs --version
21+
pip3 show mkdocs-material
2022
- name: Clone modm-ext/modm.io repository
2123
uses: actions/checkout@v2
2224
with:
@@ -45,9 +47,9 @@ jobs:
4547
steps:
4648
- name: Check out repository
4749
uses: actions/checkout@v2
48-
- name: Update submodules and install lbuild
50+
- name: Update submodules and update modm tools
4951
run: |
50-
(git submodule sync && git submodule update --init --jobs 8) & pip3 install -U lbuild & wait
52+
(git submodule sync && git submodule update --init --jobs 8) & pip3 install --upgrade --upgrade-strategy=eager modm & wait
5153
- name: Full run of docs.modm.io-generator-script
5254
run: |
5355
export TERM=xterm-256color

.github/workflows/linux.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,11 @@ jobs:
303303
steps:
304304
- name: Check out repository
305305
uses: actions/checkout@v2
306-
- name: Update submodules and install lbuild
306+
- name: Update submodules and update modm tools
307307
run: |
308-
(git submodule sync && git submodule update --init --jobs 8) & pip3 install --upgrade --upgrade-strategy=eager modm & wait
308+
(git submodule sync && git submodule update --init --jobs 8) & pip3 install --upgrade --upgrade-strategy=eager modm mkdocs mkdocs-material & wait
309+
mkdocs --version
310+
pip3 show mkdocs-material
309311
- name: Test run of docs.modm.io-generator-script
310312
if: always()
311313
run: |
@@ -322,6 +324,10 @@ jobs:
322324
run: |
323325
python3 tools/scripts/synchronize_docs.py
324326
python3 tools/scripts/generate_module_docs.py
327+
cat docs/mkdocs.yml
328+
ls -l docs/src/reference
329+
ls -l docs/src/reference/config
330+
ls -l docs/src/reference/module
325331
(cd docs && mkdocs build)
326332
- name: Upload Homepage Documentation
327333
uses: actions/upload-artifact@v2

README.md

Lines changed: 90 additions & 89 deletions
Large diffs are not rendered by default.

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ src/index.md
33
src/who-we-are.md
44
src/guide/examples.md
55
src/reference/module
6+
src/reference/config
7+
src/reference/targets.md
68

79
# ignored since this is generated by mkdocs
810
modm.io/

docs/config.md.in

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# {{ config.title if config.title else config.name }}
2+
3+
lbuild config: `{{config.name}}`
4+
5+
{{config.description}}
6+
7+
%% if config.default != ""
8+
Default: `{{config.default}}`
9+
Revisions: `[{{config.revisions}}]`
10+
%% endif
11+
%#
12+
## Configuration
13+
14+
```xml
15+
{{config.configs[config.default]}}
16+
```

docs/mkdocs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ nav:
9191
- Reference:
9292
- Documentation: reference/documentation.md
9393
- Build Systems: reference/build-systems.md
94+
- Supported Targets: reference/targets.md
95+
# configtable
96+
# - Configurations:
97+
# - config: config.md
98+
# /configtable
9499
# moduletable
95100
# - Modules:
96101
# - module: module.md

docs/src/guide/custom-project.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ discover all of modm yet. You can now choose from two levels of customization:
9595

9696
Use lbuild to discover the specific BSP configuration you want to use.
9797
Some board configurations support different hardware revisions, so check your
98-
hardware to select the right one:
98+
hardware to select the right one. For this example, we are going to use
99+
[the DISCO-F469NI Rev B-03 board config](../../reference/config/modm-disco-f469ni).
99100

100101
```
101102
$ lbuild discover
@@ -183,7 +184,7 @@ it's better to use your own BSP:
183184

184185
## Custom Configuration
185186

186-
For completely custom hardware, you start by definining the `modm:target` option
187+
For completely custom hardware, you start by defining the `modm:target` option
187188
and then adding the modules with their options as needed. For example, a basic
188189
configuration for the STM32F469NIH6 with startup, GPIO and clock modules looks
189190
like this:

docs/src/guide/discover.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Parser(lbuild)
2525
```
2626

2727
This gives you an overview of the repositories and their options and
28-
configurations. Here you can see the `modm:target` option is marked as
29-
*REQUIRED*, since the HAL modules obviously depend on the target device, so we
30-
need to discover the option in detail:
28+
configurations. Here you can see [the `modm:target` option](../../reference/targets)
29+
is marked as *REQUIRED*, since the HAL modules obviously depend on the target
30+
device, so we need to discover the option in detail:
3131

3232
```
3333
$ lbuild -r repo.lb discover modm:target

docs/targets.md.in

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Supported Targets
2+
3+
modm supports a total of {{total}} targets by setting the `modm:target`
4+
repository option with the device identifier string.
5+
6+
{{description}}
7+
8+
%% for platform, families in targets.items() | sort
9+
## {{platform}}
10+
%#
11+
%% if "Hosted" in platform
12+
The hosted targets are for compiling modm on an operating system, usually to run
13+
our unit tests locally or in the CI.
14+
15+
Identifier format example for `Hosted-Linux`:
16+
17+
```
18+
hosted linux
19+
{platform}-{family}
20+
```
21+
%% elif "AVR" in platform
22+
Identifier format example for `ATmega328P-AU`:
23+
```
24+
avr mega 328 p au
25+
{platform}{family}{name}{type}-{speed}{package}
26+
```
27+
Note that the platform is mapped to `avr` not `at` and that some AVRs have an
28+
optional device speed.
29+
30+
Identifier format example for `AT90CAN128-16AU`:
31+
```
32+
avr 90 can 128 16 au
33+
{platform}{family}{type}{name}-{speed}{package}
34+
```
35+
Note that the type and name are switched here to normalize the identifier
36+
schema.
37+
%% elif "STM32" in platform
38+
Identifier format example for `STM32G071GBU6N/revY`:
39+
```
40+
stm32 g0 71 g b u 6 n y
41+
{platform}{family}{name}{pin}{size}{package}{temperature}{variant}{revision}
42+
```
43+
The revision is optional, however, the device variant often means significant
44+
differences in pinout or peripherals, so check your device's identifier twice!
45+
%% elif "SAM" in platform
46+
Identifier format example for `SAMD21G18A-AU`:
47+
```
48+
sam d 21 g 18 a a u
49+
{platform}{family}{series}{pin}{flash}{variant}-{package}{grade}
50+
```
51+
%% elif "Raspberry" in platform
52+
Identifier format example for `RP2040`:
53+
```
54+
rp 2 0 4 0
55+
{platform}{cores}{type}{ram}{flash}
56+
```
57+
%% endif
58+
%#
59+
%% for family, prefixes in families.items() | sort
60+
%% if family | length and prefixes | length > 1
61+
### {{family}}
62+
%#
63+
%% endif
64+
%% for prefix, devices in prefixes.items() | sort
65+
%% if prefix | length
66+
#### {{prefix}}
67+
%#
68+
%% endif
69+
`{{ devices | sort | join("`, `") }}`.
70+
%#
71+
%#
72+
%% endfor
73+
%#
74+
%% endfor
75+
%#
76+
%% endfor

docs/who-we-are.md.in

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
{{authors}}
55

6-
<!-- (⚡️ expand on authors responsibilities and focus of past/current modm work) -->
7-
8-
96
## History of modm
107

118
In the mid-2000s the [Roboterclub Aachen e.V.][rca_ev] has developed a software
@@ -14,8 +11,8 @@ PCs and microcontrollers. This library was initially used only in autonomous
1411
robots for the [Eurobot competition][eurobot].
1512

1613
In 2009, XPCC became a separate project and over the years grew from a communication
17-
library to a general purpose framework (called lowercase xpcc, 'cos #namingthings) suitable for all
18-
kinds of embedded applications.
14+
library to a general purpose framework (called lowercase xpcc) suitable for all
15+
kinds of embedded applications, which made it quite messy.
1916

2017
Between 2016 and 2018, Niklas and Fabian refactored xpcc into modm by completely
2118
rewriting the way the library generates its HAL. This also gave us the tools to
@@ -41,3 +38,5 @@ Check out how we're competing in the quarter finals of the Eurobot 2015 competit
4138
</div>
4239

4340
{{links}}
41+
42+
[rca_ev]: https://www.roboterclub.rwth-aachen.de

0 commit comments

Comments
 (0)