Skip to content

fix(api): playFile prepends the language path, fix volume example - #36

Merged
pfeerick merged 1 commit into
edgetx_2.12from
fix-2.12-playfile
Oct 23, 2026
Merged

pfeerick merged 1 commit into
edgetx_2.12from
fix-2.12-playfile

Conversation

@pfeerick

Copy link
Copy Markdown
Member

Summary

Ports the fix from @arkarkark's #10 to the MkDocs 2.12 docs:

  • Relative paths: the current language's sound directory is prepended to a relative filename, not appended. luaPlayFile() writes the language path into the buffer first (getAudioPath()) and copies the filename after it.
  • Example: the playFile("armed.wav", 5) comment said "use Wav volume 2". It now says 5. This example only appears in the LuaLS stubs and the internal review page.

How

The 2.12 API pages are generated from the firmware's luadoc comments. The upstream fix is EdgeTX/edgetx#7936. To avoid waiting for that PR and a full re-extract, which would also pull in unrelated firmware drift, I edited the playFile entry in the committed docs-system/generated/api-model.local.json to match the upstream fix and regenerated:

uv run python tools/docs_pipeline.py build --input docs-system/generated/api-model.local.json \
  --overlay-dir docs-system/overlays --docs-output website/md-docs/api-reference \
  --luals-output docs-system/generated/luals website/md-docs/assets/luals

Rebuilding from the unmodified model reproduces the committed tree exactly, so the only outputs that change are:

  • the playFile page;
  • its review page;
  • the two runtime.d.lua stub copies.

mkdocs build --strict passes.

The next real re-extract from firmware produces the same text once EdgeTX/edgetx#7936 is in. That covers main/dev, and 2.12 too if the firmware fix is backported to the 2.12 branch.

Supersedes #10, credited as co-author.

🤖 Generated with Claude Code

A relative filename gets the current language's sound directory put in
front of it, so the language is prepended, not appended. The first
example passes volume 5 but its comment said 2.

Patched the playFile entry in the committed API model to match the
upstream luadoc fix (EdgeTX/edgetx#7936) and regenerated with
`docs_pipeline.py build`. The only outputs that change are the playFile
page, its review page and the LuaLS stubs.

Supersedes #10.

Co-Authored-By: Alex K <arkarkark@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview: https://pr-36-edgetx-lua-reference-guide.edgetx.workers.dev/2.12/

Built from c716825 as the 2.12 version, on top of the currently published site.

@pfeerick
pfeerick merged commit 90592b2 into edgetx_2.12 Oct 23, 2026
4 checks passed
@pfeerick
pfeerick deleted the fix-2.12-playfile branch October 23, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant