build know tonies markdown table for each language on

This commit is contained in:
b2un0 2025-02-28 17:08:41 +01:00
parent a32785e440
commit 4f789ab2ba
No known key found for this signature in database
4 changed files with 71 additions and 5 deletions

26
.github/workflows/known_tonies.yaml vendored Normal file
View file

@ -0,0 +1,26 @@
name: build known tonies for each language
on:
push:
workflow_dispatch:
jobs:
known_tonies:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: build known tonies
run: ./build_known_tonies.sh
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: '*/*.md'
commit_message: update language specific known tonies list

View file

@ -2,6 +2,7 @@ name: Validate NFC Files
on:
push:
workflow_dispatch:
pull_request:
types: [ opened, synchronize, reopened ]

View file

@ -1,13 +1,20 @@
# Toniebox NFC Files
This repo contains `.nfc` files to be used with Flipper Zero. Just place them in your `nfc` folder, and then emulate them.
Pull requests welcome!
**Usage Notes**
### Usage Notes
* Reading/emulating SLIX-L chips is a fairly new addition to the official Flipper Zero firmware. It disappeared for a few releases and came back as of `0.99.1` (with a different file format), so make sure you are on that version or newer. I'm not sure about unofficial firmwares and which versions support this yet.
* The Tonie Box downloads the audio data from servers, so it is possible that the data in this repo no longer works at some point. Keep that in mind if you are uploading your kid's cherished figures.
* Reading/emulating SLIX-L chips is a fairly new addition to the official Flipper Zero firmware.
It disappeared for a few releases and came back as of `0.99.1` (with a different file format), so make sure you are on that version or newer.
I'm not sure about unofficial firmwares and which versions support this yet.
* The Tonie Box downloads the audio data from servers, so it is possible that the data in this repo no longer works at some point.
Keep that in mind if you are uploading your kid's cherished figures.
**Pull Requests**
### Pull Requests
If you want to add new Tonies, it will help to run `validation.sh`. If it detects something wrong with any of the files, it will tell you, and you can fix it before submitting the PR. Otherwise it will output no message at all. I will also run this from time to time and clean up files as needed.
If you want to add new Tonies, it will help to run `validation.sh`.
If it detects something wrong with any of the files, it will tell you, and you can fix it before submitting the PR.
Otherwise, it will output no message at all.
I will also run this from time to time and clean up files as needed.

32
build_known_tonies.sh Executable file
View file

@ -0,0 +1,32 @@
#!/usr/bin/env bash
echo "Building known tonies for each folder"
while read -r LANG_DIR; do
NFC_FILES=()
while IFS= read -r -d '' NFC_FILE; do
NFC_FILES+=("${NFC_FILE}")
done < <(find "${LANG_DIR}" -type f -name "*.nfc" -print0 | sort -z)
FOLDER=$(basename "${LANG_DIR}")
NFC_FILES_COUNT=${#NFC_FILES[@]}
echo "${FOLDER} has ${NFC_FILES_COUNT}"
{
echo "# ${NFC_FILES_COUNT} ${FOLDER} NFC Files"
echo ""
echo "automatically generated, do not edit"
echo ""
echo "| Folder | Filename |"
echo "|--------|----------|"
} > "${LANG_DIR}/README.md"
for FILE_PATH_ABS in "${NFC_FILES[@]}"; do
FILE_NAME=$(basename "$FILE_PATH_ABS")
FILE_PATH_REL=${FILE_PATH_ABS#"${LANG_DIR}/"}
FILE_PATH_REL_ENC=$(echo "$FILE_PATH_REL" | awk '{gsub(/ /, "%20"); print}')
FOLDER_NAME_REL=$(dirname "${FILE_PATH_REL}")
printf "| %s | [%s](%s) |\n" "${FOLDER_NAME_REL}" "${FILE_NAME}" "${FILE_PATH_REL_ENC}" >> "${LANG_DIR}/README.md"
done
done < <(find "." -maxdepth 1 -type d ! -name ".*")