.. leading zeros are required for `frontmatter` to treat them as dates
rather than strings, apparently per the YAML specification.
This was done by script:
```py
import re
import datetime
import pathlib
import sys
import frontmatter
rx = re.compile(r'^(\s*)date_added:.*$', re.M)
for path_str in sys.argv[1:]:
print(path_str)
path = pathlib.Path(path_str)
post = frontmatter.load(path)
date_added = post.get("date_added", "")
if isinstance(date_added, datetime.date):
continue
if isinstance(date_added, str):
try:
date_added = datetime.datetime.strptime(date_added, "%Y-%m-%d")
except ValueError as exc:
print(f"Failed to parse date {date_added} in {path_str}: {exc}")
continue
date_added = date_added.date()
content = path.read_text("utf-8")
new_content = rx.sub(lambda m: f"{m.group(1)}date_added: {date_added}", content)
assert content != new_content
path.write_text(new_content, "utf-8")
```
1.5 KiB
| layout | board_id | title | name | manufacturer | board_url | board_image | date_added | family | features | |||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| download | pimoroni_keybow2040 | Keybow 2040 Download | Keybow 2040 | Pimoroni |
|
pimoroni_keybow2040.jpg | 2021-02-24 | raspberrypi |
|
A luxe 16 key USB-C keyboard with tactile mechanical switches and fully customisable RGB lighting, ideal for custom macro pads, midi controllers and stream decks. RP2040 gives Keybow 2040 low latency input, zero boot time and a new, compact footprint.
Features
- 16 (4x4 matrix) of low profile keys connected directly to GPIOs
- Per key RGB LEDs driven by an IS31FL3731 PWM LED matrix driver
- Kailh hot-swap switch sockets (for Cherry MX-compatible switches)
- Powered and programmable via USB-C
About the RP2040
The RP2040 microcontroller is a dual core ARM Cortex M0+ running at up to 133Mhz. It bundles in 264kB of SRAM, 30 multifunction GPIO pins (including a four channel 12-bit ADC), a heap of standard peripherals (I2C, SPI, UART, PWM, clocks, etc), and USB support.
One very exciting feature of the RP2040 microcontroller are the programmable IOs which allow you to execute custom programs that can manipulate GPIO pins and transfer data between peripherals - they can offload tasks that require high data transfer rates or precise timing that traditionally would have required a lot of heavy lifting from the CPU.