Skip to content
This repository has been archived by the owner on Jan 25, 2019. It is now read-only.

Idea: add markdown support via pandoc #14

Open
charlesreid1 opened this issue May 6, 2018 · 1 comment
Open

Idea: add markdown support via pandoc #14

charlesreid1 opened this issue May 6, 2018 · 1 comment

Comments

@charlesreid1
Copy link

charlesreid1 commented May 6, 2018

I've found that pandoc does a surprisingly good job of converting Google Docs documents with complicated tables, headings, bullet lists, etc. into reasonable-looking Markdown files (with a few formatting issues that can be cleaned up via a script or via markdown linting) if you use the Github-flavored markdown output format and convert from docx. For example:

pandoc -f docx -t gfm -o MyDocument.md MyDocument.docx

I'd like to implement a --markdown flag in gitdriver that would download the Google Doc using docx mime type, then include an extra step of converting to Github-flavored markdown using pandoc and cleaning up the intermediate docx file. Is that something you'd be interested in adding?

Pro: Your users would now have markdown as an output format option

Con: Some of the inevitable formatting issues that occur when going from docx to markdown may surprise users (violating principle of least-surprise). But warning the user should take care of this.


As an example of the kind of formatting issues I'm referring to:

If there is a line with bold text, and it ends in a space, the space is not ignored, so you end up with the following (invalid) attempt at making the text in the Markdown file bold:

**This is some bold text. **

which does not render correctly in Markdown:

**This is some bold text. **

Bullet list items that span multiple lines have blockquote > in front of them, e.g.,

  • Inventore sit non voluptas quidem. Aut nobis fuga facilis rerum et nisi cupiditate ut. Quod quisquam deserunt et ipsum aut velit et numquam. Nihil ab dolorem molestiae dolore voluptate. Et aut ea veritatis velit ipsa repellendus.

  • Architecto repudiandae eius sunt ipsa. Quos non dicta id nihil quaerat veniam est sed. Illum laboriosam accusantium dolores totam fugiat animi iusto nihil. Facilis dolores libero mollitia impedit minus iste.

Those are the main two I noticed, there may be a few others but they're minor by comparison.

@larsks
Copy link
Owner

larsks commented May 6, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants