9 ms·
Pandoc (https://pandoc.org https://pandoc.org) can be used to convert a .docx file to markdown and other file formats like djot and typst. I don't think pandoc
by figomore 2y ago
Pandoc (https://pandoc.org https://pandoc.org) can be used to convert a .docx file to markdown and other file formats like djot and typst. I don't think pandoc can convert powerpoint and excel files.
- disgruntledphd2 2y agoYeah that was the interesting part to me, at least. Plus, it's Microsoft so hopefully it will work for their files.
- LordDragonfang 2y ago...I did not catch that it was from Microsoft. I was wondering why a random markdown converter was so notable.
- _rs 2y agoThat was the first thing I checked, and it looks like they’re using some existing python package to parse docx files. I wonder if they contributed to it or vetted it strongly
- disgruntledphd2 2y agoWow, I dunno if that's good or bad, certainly it's not what I expected.
- wis 2y agoLooking at the code, it looks like they used existing Python packages to read and parse MS Office formats, not what I expected, seeing that the repo is in Microsoft's org on GitHub I expected them to have used Microsoft's "official" libraries for parsing these formats, through Component Object Model (COM). They used Mammoth for docx (Word) [1][2] Python-pptx for ppt (PowerPoint) [3][4] and Pandas for XSLX (Excel) [5] [1] https://github.com/microsoft/markitdown/blob/70ab149ff1657c327ebd6ca940988f5d3c5d80d0/src/markitdown/_markitdown.py#L495 https://github.com/microsoft/markitdown/blob/70ab149ff1657c3... [2] https://pypi.org/project/mammoth/ https://pypi.org/project/mammoth/ [3] https://github.com/microsoft/markitdown/blob/70ab149ff1657c327ebd6ca940988f5d3c5d80d0/src/markitdown/_markitdown.py#L539 https://github.com/microsoft/markitdown/blob/70ab149ff1657c3... [4] https://pypi.org/project/python-pptx/ https://pypi.org/project/python-pptx/ [5] https://github.com/microsoft/markitdown/blob/70ab149ff1657c327ebd6ca940988f5d3c5d80d0/src/markitdown/_markitdown.py#L513 https://github.com/microsoft/markitdown/blob/70ab149ff1657c3...
- jamwil 2y agoCOM requires you to interact with the files through the associated MS Office applications, whereas these libs parse the ooxml file format directly.
- zamadatix 2y agoThe hard part about document conversion is not finding a tool which can convert the formats but the tool which does it best. I wonder how MarkItDown ranks for the tasks for the various types.
- jez 2y agoThe README of MarkItDown mentions "indexing and text analysis" as the two motivating features, whereas Pandoc is more interested in document preparation via conversion that maintains rich text formatting. Since my personal use leans towards the latter, I'm hesitant to believe that this tool will work better for me but others may have other priorities.
- gbraad 2y agoMarkItDown feels like running strings; the output is great for text extraction and processing, not for reading by humans