.. 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")
```
44 lines
2 KiB
Markdown
44 lines
2 KiB
Markdown
---
|
||
layout: download
|
||
board_id: "m5stack_cardputer"
|
||
title: "M5Stack CardPuter - M5StampS3 powered mini computer Download"
|
||
name: "M5Stack CardPuter - M5StampS3 powered mini computer"
|
||
manufacturer: "M5Stack"
|
||
board_url:
|
||
- "https://docs.m5stack.com/en/core/Cardputer"
|
||
board_image: "m5stack_cardputer.jpg"
|
||
date_added: 2024-03-10
|
||
family: esp32s3
|
||
bootloader_id: adafruit_feather_esp32s3_nopsram
|
||
downloads_display: true
|
||
features:
|
||
- Speaker
|
||
- Battery Charging
|
||
- Display
|
||
- Wi-Fi
|
||
- USB-C
|
||
- Bluetooth/BTLE
|
||
---
|
||
|
||
Cardputer is a card-sized portable computer that is perfect for engineers. At the heart of Cardputer is the M5StampS3, a mini development board based on the ESP32-S3 chip. Cardputer features a powerful dual-core processor, supports Wi-Fi functionality and integrates various peripherals and sensors, making it ideal for rapid functional verification, industrial control and home automation systems.
|
||
|
||
The device is powered by an internal 120mAh+1400mAh (in the base) lithium battery solution, eliminating concerns about battery life. In addition, Cardputer has built-in battery charging and voltage regulation circuits that automatically adjust voltage and current to protect the battery and the device. The base of the Cardputer incorporates a magnet, allowing it to be attached to metal surfaces such as fridges or whiteboards. What’s more, Cardputer's structure is compatible with Lego hole extensions, allowing users to create even more interesting designs using Lego bricks.
|
||
|
||
### Features
|
||
- Display: IPS LCD, 1,14", 240x135px
|
||
- Battery: internal 120mAh + 1400mAh (in the base) lithium battery
|
||
- TF-Card (MicroSD) slot
|
||
- 1 USB-C OTG in/out
|
||
- Keyboard: 56 keys, QWERTY type, ortholinear with tactile click switches
|
||
- Infrared ∠0° : 410cm, < 90° : 66cm, < 45° : 170cm
|
||
- Digital MEMS Microphone
|
||
- Sound: I2S-Speaker, 8Ω@1W
|
||
- HY2.0-4P interface for expanding I2C sensors
|
||
|
||
## Documentation
|
||
|
||
* [Cardputer](https://docs.m5stack.com/en/core/Cardputer)
|
||
|
||
## Purchase
|
||
|
||
* [M5Stack](https://shop.m5stack.com/products/m5stack-cardputer-kit-w-m5stamps3)
|