We did it the other way around first, but it was a huge hassle and very hacky. Since we flipped it we've been much more satisfied with the system.
It's somewhat inspired by literate programming, but a bit flipped.