This commit is contained in:
Melissa LeBlanc-Williams 2022-05-10 08:05:57 -07:00
commit 10a62afa97
4 changed files with 26 additions and 2 deletions

View file

@ -30,6 +30,10 @@ jobs:
- uses: actions/checkout@v1
with:
submodules: true
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: 3.x
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
@ -38,6 +42,9 @@ jobs:
run: |
gem install bundler:1.17.3
bundle install --full-index
pip install python-frontmatter
- name: Check feature names
run: python3 check-features.py
- name: Build site with jekyll
run: |
bundle exec jekyll build -d build

View file

@ -10,7 +10,7 @@ download_instructions:
date_added: 2021-2-14
features:
- Wi-Fi
- Bluetooth/BLE
- Bluetooth/BTLE
- STEMMA QT/QWIIC
- Arduino Shield Compatible
- USB-C

View file

@ -8,7 +8,6 @@ board_url: "https://www.raspberrypi.com/products/raspberry-pi-zero/"
board_image: "raspberry_pi_zero.jpg"
date_added: 2022-2-14
features:
- 40-pin GPIO
---
**NOTE**: Not all features are supported in CircuitPython.

18
check-features.py Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/python3
from pathlib import Path
import frontmatter
with open('template.md', "rt") as f:
metadata, content = frontmatter.parse(f.read())
acceptable_features = set(metadata['features'])
failed = False
for filename in Path('_board').glob("*.md"):
with open(filename, "rt") as f:
metadata, content = frontmatter.parse(f.read())
features = metadata.get('features') or ()
for feature in sorted(set(features) - acceptable_features):
print(f"{filename}:0: Non-standard feature: {feature}")
failed = True
raise SystemExit(failed)