Skip to content

Update NTTT to handle modern markdown#6

Merged
jamdelion merged 11 commits into
mainfrom
jh/modern-markdown
May 15, 2026
Merged

Update NTTT to handle modern markdown#6
jamdelion merged 11 commits into
mainfrom
jh/modern-markdown

Conversation

@jamdelion

@jamdelion jamdelion commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

I've been testing out the GH actions in this test repo: https://github.com/raspberrypilearning/test-markdown-alien

Main changes in this PR:

  • add transformations.md to document in plain English what exactly the NTTT script does
  • Make changes to the script to be able to parse/tidy modern RPF markdown
  • Add in restore/strip functionality to replace the existing hide-strings.yml action that is implemented in some projects. This is to hide non-translatable elements like --- task --- and ![TASK].

Next steps:

@jamdelion jamdelion changed the title Jh/modern markdown Update NTTT to handle modern markdown, plus hide strings functionality May 5, 2026
@jamdelion jamdelion changed the title Update NTTT to handle modern markdown, plus hide strings functionality Update NTTT to handle modern markdown May 5, 2026
@jamdelion jamdelion marked this pull request as ready for review May 14, 2026 09:53
@jamdelion jamdelion requested a review from Copilot May 14, 2026 10:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py modules implementing classification, stripping and round-trip restoration of modern and legacy markers, plus a new --mode CLI flag wired through arguments.py, constants.py, and __init__.py.
  • tidyup.py now invokes restore_tree before 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.

Comment thread nttt/tidyup.py
Comment thread nttt/restore.py
Comment thread nttt/restore.py
Comment thread nttt/__init__.py
Comment thread README.md
Comment thread unit_test/test_arguments.py Outdated
Comment thread nttt/markers.py Outdated
Comment thread nttt/strip.py
jamdelion and others added 3 commits May 14, 2026 11:42
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jamdelion jamdelion merged commit 995d998 into main May 15, 2026
6 checks passed
@jamdelion jamdelion deleted the jh/modern-markdown branch May 15, 2026 14:58
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.

4 participants