Update NTTT to handle modern markdown#6
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates NTTT to handle modern RPF Markdown (> [!TASK]/> [!ACCORDION] … callouts) by adding two new processing modes — strip (removes non-translatable structural markers before Crowdin upload) and restore (reinserts them after download) — and integrates restore into the default tidy pipeline for non-English locales. Adds maintainer-facing documentation describing all transformations.
Changes:
- New
nttt/markers.py,nttt/strip.py,nttt/restore.pymodules implementing classification, stripping and round-trip restoration of modern and legacy markers, plus a new--modeCLI flag wired througharguments.py,constants.py, and__init__.py. tidyup.pynow invokesrestore_treebefore the existing cleanup pass for non-English locales.- Adds
doc/transformations.md, README sections, fixture markdown files and unit tests covering strip/restore, marker classification, and the strip→restore roundtrip.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| nttt/markers.py | New marker classification (modern bare/labelled, legacy bare, empty blockquote). |
| nttt/strip.py | Implements strip_md / strip_tree removing structural markers outside fenced code. |
| nttt/restore.py | Implements restore_md / restore_tree and "looks already processed" guard. |
| nttt/tidyup.py | Calls restore_tree before per-file fix loop for non-English locales. |
| nttt/init.py | Dispatches CLI to strip/restore/tidy based on new --mode. |
| nttt/arguments.py | Adds -m/--mode CLI flag with tidy/strip/restore choices. |
| nttt/constants.py | Adds MODE argument key and Modes constants. |
| README.md | Documents new modes, pipx instructions, link to transformations.md. |
| doc/transformations.md | New maintainer-facing reference for NTTT's transformations. |
| unit_test/test_markers.py | Tests classify_line and helpers. |
| unit_test/test_strip.py | Tests strip_md behaviour incl. code-fence preservation. |
| unit_test/test_restore.py | Tests restore_md happy paths, warnings, and skip heuristics. |
| unit_test/test_strip_restore_roundtrip.py | Roundtrip tests using fixture markdown. |
| unit_test/test_cleanup_sections.py | Regression test that restore + fix_sections doesn't duplicate markers. |
| unit_test/test_arguments.py | Adds mode field to fake args and asserts defaults. |
| unit_test/data/markdown/*.md | New fixtures (accordions, nested markers, legacy quiz). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/raspberrypilearning/nttt/sessions/1aeaef6f-3256-41b4-a506-c079faf858d2 Co-authored-by: jamdelion <31373245+jamdelion@users.noreply.github.com>
Agent-Logs-Url: https://github.com/raspberrypilearning/nttt/sessions/1aeaef6f-3256-41b4-a506-c079faf858d2 Co-authored-by: jamdelion <31373245+jamdelion@users.noreply.github.com>
rammodhvadia
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've been testing out the GH actions in this test repo: https://github.com/raspberrypilearning/test-markdown-alien
Main changes in this PR:
transformations.mdto document in plain English what exactly the NTTT script doeshide-strings.ymlaction that is implemented in some projects. This is to hide non-translatable elements like--- task ---and![TASK].Next steps: