.. 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.2 KiB
1.2 KiB
| layout | board_id | title | name | manufacturer | board_url | board_image | date_added | family | ||
|---|---|---|---|---|---|---|---|---|---|---|
| download | pimoroni_pico_dv_base | Pimoroni Pico DV Demo Base for Pico Download | Pimoroni Pico DV Demo Base for Pico | Pimoroni |
|
pimoroni_pico_dv_base.jpg | 2023-05-04 | raspberrypi |
A demo board for exploring the digital video and audio capabilities of Raspberry Pi Pico, with HDMI connector, SD card slot, line level I2S audio and buttons.
Features
- HDMI connector
- PCM5100A DAC for line out audio over I2S datasheet
- SD card slot
- Reset button
- Socket headers to install your Raspberry Pi Pico
- Three user-controllable switches
- Rubber feet
- Compatible with Raspberry Pi Pico
- No soldering required (as long as your Pico has header pins attached)
- Programmable with C/C++
- Schematic