.. 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")
```
37 lines
No EOL
1.6 KiB
Markdown
37 lines
No EOL
1.6 KiB
Markdown
---
|
|
layout: download
|
|
board_id: "m5stack_atom_matrix"
|
|
title: "ATOM Matrix ESP32 Download"
|
|
name: "ATOM Matrix ESP32"
|
|
manufacturer: "M5Stack"
|
|
board_url:
|
|
- "https://docs.m5stack.com/en/core/atom_matrix"
|
|
- "https://www.adafruit.com/product/4497"
|
|
board_image: "m5stack_atom_matrix.jpg"
|
|
date_added: 2023-01-31
|
|
family: esp32
|
|
features:
|
|
- Wi-Fi
|
|
- USB-C
|
|
- Bluetooth/BTLE
|
|
- Display
|
|
---
|
|
|
|
ATOM Matrix, which has a size of only 24 * 24mm, is the most compact development board in the M5Stack development kit series. It provides more GPIO pins and is very suitable for handy and miniature embedded device development. The main control adopts the ESP32-PICO-D4 chip, which comes integrated with Wi-Fi technologies and has 4MB of integrated SPI flash memory. The Atom board provides an Infra-Red LED along with the 5 * 5 RGB LED matrix on the panel, a built-in IMU sensor (MPU6886), and a HY2.0 interface. A general purpose programmable button is proved below the RGB Led matrix to enable users to add input support to their various projects. The on-board USB interface (Type-C) enables rapid program uploading and execution. One M2 screw hole is provided on the back for mounting the board.
|
|
|
|
### Features
|
|
- ESP32 PICO-based
|
|
- Programmable button
|
|
- 5 * 5 RGB LED matrix panel(WS2812C)
|
|
- Built-in Infra-red LED
|
|
- Built-in MPU6886 Inertial Sensor
|
|
- Extendable Pins & Holes
|
|
|
|
## Documentation
|
|
|
|
* [ATOM Matrix](https://docs.m5stack.com/en/core/atom_matrix)
|
|
|
|
## Purchase
|
|
|
|
* [Adafruit](https://www.adafruit.com/product/4497)
|
|
* [M5Stack](https://shop.m5stack.com/collections/m5-controllers/products/atom-matrix-esp32-development-kit) |