diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95a408fc..35b8c394 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/_board/diodes_delight_piunora.md b/_board/diodes_delight_piunora.md index f9000a65..9c493d3a 100644 --- a/_board/diodes_delight_piunora.md +++ b/_board/diodes_delight_piunora.md @@ -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 diff --git a/_board/raspberrypi_zero.md b/_board/raspberrypi_zero.md index eaa2acfa..273c0727 100644 --- a/_board/raspberrypi_zero.md +++ b/_board/raspberrypi_zero.md @@ -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. diff --git a/check-features.py b/check-features.py new file mode 100755 index 00000000..4e0d043f --- /dev/null +++ b/check-features.py @@ -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)