From 39410d01df6ecb42a81c4219bdbd3ff6e21b8bfd Mon Sep 17 00:00:00 2001 From: Sugato Ray Date: Wed, 18 Dec 2024 14:22:58 -0500 Subject: [PATCH 1/5] Update CLI helpdoc formatting to allow indentation in code Use `textwrap.dedent()` to allow indented cli-helpdoc in `__main__.py` file. The indentation increases readability, while `textwrap.dedent` helps maintain the same functionality without breaking code. --- src/markitdown/__main__.py | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/markitdown/__main__.py b/src/markitdown/__main__.py index 2d53173..9c48cd4 100644 --- a/src/markitdown/__main__.py +++ b/src/markitdown/__main__.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: MIT import sys import argparse +from textwrap import dedent from ._markitdown import MarkItDown @@ -10,24 +11,24 @@ def main(): parser = argparse.ArgumentParser( description="Convert various file formats to markdown.", formatter_class=argparse.RawDescriptionHelpFormatter, - usage=""" -SYNTAX: - - markitdown - If FILENAME is empty, markitdown reads from stdin. - -EXAMPLE: - - markitdown example.pdf - - OR - - cat example.pdf | markitdown - - OR - - markitdown < example.pdf -""".strip(), + usage=dedent(""" + SYNTAX: + + markitdown + If FILENAME is empty, markitdown reads from stdin. + + EXAMPLE: + + markitdown example.pdf + + OR + + cat example.pdf | markitdown + + OR + + markitdown < example.pdf + """).strip(), ) parser.add_argument("filename", nargs="?") From 356e895306baf01633ebacd5888487321c940f6a Mon Sep 17 00:00:00 2001 From: Sugato Ray Date: Wed, 18 Dec 2024 21:25:23 +0000 Subject: [PATCH 2/5] update formatting with pre-commit --- src/markitdown/__main__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/markitdown/__main__.py b/src/markitdown/__main__.py index 9c48cd4..be2a0f2 100644 --- a/src/markitdown/__main__.py +++ b/src/markitdown/__main__.py @@ -11,7 +11,8 @@ def main(): parser = argparse.ArgumentParser( description="Convert various file formats to markdown.", formatter_class=argparse.RawDescriptionHelpFormatter, - usage=dedent(""" + usage=dedent( + """ SYNTAX: markitdown @@ -28,7 +29,8 @@ def main(): OR markitdown < example.pdf - """).strip(), + """ + ).strip(), ) parser.add_argument("filename", nargs="?") From 1384e8072578278977ec6d67c852f9c2f79d799e Mon Sep 17 00:00:00 2001 From: Sugato Ray Date: Wed, 18 Dec 2024 21:24:57 +0000 Subject: [PATCH 3/5] update .gitignore to exclude .vscode folder --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 82f9275..e6c8f2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.vscode + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] From 6e1b9a7402f425b3a740051a35db0fcd336ce549 Mon Sep 17 00:00:00 2001 From: gagb Date: Wed, 18 Dec 2024 13:46:10 -0800 Subject: [PATCH 4/5] Run precommit --- src/markitdown/__main__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/markitdown/__main__.py b/src/markitdown/__main__.py index 9c48cd4..be2a0f2 100644 --- a/src/markitdown/__main__.py +++ b/src/markitdown/__main__.py @@ -11,7 +11,8 @@ def main(): parser = argparse.ArgumentParser( description="Convert various file formats to markdown.", formatter_class=argparse.RawDescriptionHelpFormatter, - usage=dedent(""" + usage=dedent( + """ SYNTAX: markitdown @@ -28,7 +29,8 @@ def main(): OR markitdown < example.pdf - """).strip(), + """ + ).strip(), ) parser.add_argument("filename", nargs="?") From 535147b2e8f99d47868c214261d62aef8117ae12 Mon Sep 17 00:00:00 2001 From: afourney Date: Thu, 19 Dec 2024 11:11:54 -0800 Subject: [PATCH 5/5] Added holiday notice. Added holiday notice. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 978327c..6dc096c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ +> [!IMPORTANT] +> (12/19/24) Hello! MarkItDown team members will be resting and recharging with family and friends over the holiday period. Activity/responses on the project may be delayed during the period of Dec 21-Jan 06. We will be excited to engage with you in the new year! + # MarkItDown [![PyPI](https://img.shields.io/pypi/v/markitdown.svg)](https://pypi.org/project/markitdown/) ![PyPI - Downloads](https://img.shields.io/pypi/dd/markitdown) - MarkItDown is a utility for converting various files to Markdown (e.g., for indexing, text analysis, etc). It supports: - PDF