Jupytext is a brilliant tool that I've used in the past to keep jupyter notebooks in sync with plain-text versions of those same notebooks. If I recall correctly, I used jupytext to keep Jupyter notebooks in sync with Markdown files that contained the same content.
I plan on using this again in the future to write a couple of books. For some of them, it's easier to write them as jupyter notebooks but then I need to convert those into markdown files so that pandoc is able to do its job converting the files into an ebook.