I often find it convenient to edit a document in one file format while storing it in another format. For example, a document can be written down in markdown, converted to a word file and edited there. And I am hoping to extract the edits and applied them back to original markdown file.
So, I would have
A.md, converted to
A.docx (e.g. using
pandoc), edited to
B.docx, and somehow apply the change set between
My question is:
Is there a reliable/automatic way to transfer the edits in word (text edits) back to the text-based files?
Of course, I can just convert
B.docx back to a markdown
B.md and overwrite
B.md. But the conversion process often introduces irreversible changes so that the loop
A2.md will produce a different
A2.md than the original markdown file
A.md. Some effects will be added/lost (due to different newlines, fonts, formatting etc.). And I'd like to avoid such loss, and keep the final document as close to the original file
A.md as possible.
Would it be possible to use
patch to do the following conversions in bash scripts:
diff B.md A2.mdsomehow to get a portable patch
apply the patch file on
I have limited experience in using
git diff, but not much with directly using
diff/patch. And I was wondering if someone can help explain the command sequence needed for such "transfer" of differences.
A.mddirectly ? There are markdown editors available.
Why don't you edit A.md directly ?. I work with others who might use a different file format/editor.