New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a script to convert docx to md #499

wants to merge 8 commits into
base: master


None yet
2 participants
Copy link

valassi commented Feb 5, 2019

No description provided.

@valassi valassi requested review from jouvin and graeme-a-stewart Feb 5, 2019


This comment has been minimized.

Copy link
Member Author

valassi commented Feb 5, 2019

Hi Graeme, Michel,

I submitted this MR with a simple script I used for docx to md conversion and subsequent tidying up. I suggest you/we try it a few times first, and only merge this when/if ot seems appropriate and sufficiently solid. Let me know if you have other comments anyway!

By the way I eventually moved from python to sed/awk, and I also implemented one point that was on Graeme's todo list, for leaving empty lines before headers.

Thanks for the help!


This comment has been minimized.

Copy link

graeme-a-stewart commented Feb 7, 2019

Hi @valassi

Super idea to improve this process with better docs and actually a script that people can use.

That said... I have to say I not really that keen on your version.

  • mac2unix, dos2unix - where to get these on a Mac or Windows machine?
    • Instead just use the newline argument to Python3's open function
  • Converting to sed/awk is utterly retrograde IMO
    • The sed is more or less ok, the awk is just gobbledygook
    • Python is just way clearer for writing this stuff in a way that is compact, comprehensible, maintainable

I improved my own pythonic converter a bit, but it does make some mistakes when there are dashes in the markdown conversion, some of them get moved to the beginning of lines and become bullets. But it's 99% good...



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment