I kind of doing this with my AoC with my literary programming approach where I add only code to the markdown file that is then processed by the MarkDownC program [1], which takes all the C fragments in de markdown file and puts them in the right order to be compilable, overwriting earlier definitions of functions and variables. So, each markdown file, one per day [2], shows all the steps how I arrived at the solution. I do use a normal editor and use copy-and-paste a lot when making new versions of a certain function.
[1] https://github.com/FransFaase/IParse/?tab=readme-ov-file#mar...
[2] https://github.com/FransFaase/AdventOfCode2024/blob/main/Day...