From 6ebef5af0cc672619c4127a7d1019dbce174c603 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Fri, 13 Dec 2024 11:06:11 -0800 Subject: [PATCH 1/2] CLI usage instructions Plus added a PyPI badge --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 5034d03..6b62356 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # MarkItDown +[![PyPI](https://img.shields.io/pypi/v/markitdown.svg)](https://pypi.org/project/markitdown/) + The MarkItDown library is a utility tool for converting various files to Markdown (e.g., for indexing, text analysis, etc.) It presently supports: @@ -23,6 +25,16 @@ result = markitdown.convert("test.xlsx") print(result.text_content) ``` +To use this as a command-line utility, install it and then run it like this: + +```bash +markitdown path-to-file.pdf +``` +This will output Markdown to standard output. You can save it like this: +```bash +markitdown path-to-file.pdf > document.md +``` + ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a From 33ce17954dea8a0a127d96817b6d1dac8e50fb9b Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Fri, 13 Dec 2024 11:09:03 -0800 Subject: [PATCH 2/2] Note about piping --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6b62356..851611e 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,10 @@ This will output Markdown to standard output. You can save it like this: ```bash markitdown path-to-file.pdf > document.md ``` +You can pipe content to standard input by omitting the argument: +```bash +cat path-to-file.pdf | markitdown +``` ## Contributing