.. 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")
```
24 lines
1.4 KiB
Markdown
24 lines
1.4 KiB
Markdown
---
|
|
layout: download
|
|
board_id: "sparkfun_lumidrive"
|
|
title: "LumiDrive Download"
|
|
name: "LumiDrive"
|
|
manufacturer: "SparkFun"
|
|
board_url:
|
|
- "https://www.sparkfun.com/products/14779"
|
|
board_image: "sparkfun_lumidrive_01.jpg"
|
|
date_added: 2019-03-09
|
|
family: atmel-samd
|
|
features:
|
|
- Battery Charging
|
|
- USB-C
|
|
---
|
|
|
|
The LumiDrive LED Driver is SparkFun's foray into all things Python on micro-controllers. With the SparkFun LumiDrive you will be able to control and personalize a whole strand of APA102s directly from the board itself. We've broken out a number of analog and digital pins from the on board SAMD21G-AU microcontroller to incorporate your own external buttons, switches, and other interfaces to interact with your addressable LED strip.
|
|
|
|
It feels like Arduino, but without the need to upload and compile code. Because the LumiDrive opens up like a USB drive on your computer when you plug it in and the code you write lives directly inside the drive it feels very much like an Arduino-device. The fact that you don't need to upload and compile code makes it a great transitionary LED driver from your traditional Arduino!
|
|
|
|
The SparkFun LumiDrive has been equipped with a USB-C connector which is capable enough to supply up to 1.5 Amps from a 3.1 USB port, a LiPo connector and charge circuit for portable power, as well as two poke-home connectors to allow you to plug in wires without the need for solder.
|
|
|
|
## Purchase
|
|
* [SparkFun](https://www.sparkfun.com/products/14779)
|