Skip to content

Commit 8eaf5a1

Browse files
committed
Clean up README.md
1 parent 38c9247 commit 8eaf5a1

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

README.md

-36
Original file line numberDiff line numberDiff line change
@@ -87,42 +87,6 @@ print(result.text_content)
8787
docker build -t markitdown:latest .
8888
docker run --rm -i markitdown:latest < ~/your-file.pdf > output.md
8989
```
90-
<details>
91-
92-
<summary>Batch Processing Multiple Files</summary>
93-
94-
This example shows how to convert multiple files to markdown format in a single run. The script processes all supported files in a directory and creates corresponding markdown files.
95-
96-
97-
```python convert.py
98-
from markitdown import MarkItDown
99-
from openai import OpenAI
100-
import os
101-
client = OpenAI(api_key="your-api-key-here")
102-
md = MarkItDown(llm_client=client, llm_model="gpt-4o-2024-11-20")
103-
supported_extensions = ('.pptx', '.docx', '.pdf', '.jpg', '.jpeg', '.png')
104-
files_to_convert = [f for f in os.listdir('.') if f.lower().endswith(supported_extensions)]
105-
for file in files_to_convert:
106-
print(f"\nConverting {file}...")
107-
try:
108-
md_file = os.path.splitext(file)[0] + '.md'
109-
result = md.convert(file)
110-
with open(md_file, 'w') as f:
111-
f.write(result.text_content)
112-
113-
print(f"Successfully converted {file} to {md_file}")
114-
except Exception as e:
115-
print(f"Error converting {file}: {str(e)}")
116-
117-
print("\nAll conversions completed!")
118-
```
119-
2. Place the script in the same directory as your files
120-
3. Install required packages: like openai
121-
4. Run script ```bash python convert.py ```
122-
123-
Note that original files will remain unchanged and new markdown files are created with the same base name.
124-
125-
</details>
12690

12791
## Contributing
12892

0 commit comments

Comments
 (0)