r/learnprogramming • • 34m ago

Resource I got tired of mentally diffing code tutorials, so I built a React/MDX library that highlights what changed on every click

Reading code tutorials usually means scrolling back and forth to figure out what actually changed between steps. I built unfold-mdx so you can learn through code walkthroughs at your own pace, with the new parts highlighted as you step forward.

Instead of manually tracking line numbers or adding diff markers, you just write each step as a full snapshot (the explanation so far + the code so far). It compares consecutive snapshots on its own and highlights the new sentences and code lines on every Next click.

What's in 0.1.0:

  • Shiki syntax highlighting
  • Step-synced highlights on images and Mermaid/SVG diagrams
  • Grid layouts, resizable panes, and custom controls
  • Headless by default with an optional theme, SSR fallback, and keyboard navigation
  • An llms.txt file so AI coding agents can write walkthroughs in the right format
2 Upvotes

0 comments sorted by