mangini / gdocs2md

Convert a Google Drive Document to the Markdown format, suitable for publishing.
Apache License 2.0
2.66k stars 621 forks source link

Not really an issue - my changes to support a new mode of operation #63

Open bafta-benj opened 5 years ago

bafta-benj commented 5 years ago

Hi There,

First off: thanks for providing this code - it has been very helpful for me.

I have made some reasonably big changes - not fixes - but a new mode of operation. I have no idea if you'll be interested in them, but I I just wanted to let you know. Because I have changed the way the script works (not email based any more) it didn't feel like a pull request was suitable.

My requirement was to have the markdown version created in Google Drive alongside the original document (in a "markdown" folder) - instead of being emailed. I also needed to enable hyperlinking from one document to another in the same directory or a sub directory. The code now looks at all links - if these refer to a document in the same directory or a sub directory then the absolute link is replaced by just a relative path name. It will also automatically (recursively) process the file being referenced - thus if you process a top level file and this links to a number of sub-files then all of the files will be processed and markdown versions created - all with suitable internal links. All in all this enables large multi-file documentation packages to be maintained in Google Drive then easily exported to Markdown files.

My version is available here: https://gist.github.com/bafta-benj/a5c432e5957ba48f98007fb802f48ca4

If this is of interest let me know - I've only just finished it and haven't used it much so there will probably be some tweaks/fixes over the next couple of weeks.

All the best

Ben