File tree Expand file tree Collapse file tree 3 files changed +5
-10
lines changed
Expand file tree Collapse file tree 3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -14,17 +14,15 @@ def main(
1414
1515 md = MarkItDown ()
1616
17- for file_path in input_path .glob ("*" ):
17+ for file_path in input_path .rglob ("*" ):
1818 if file_path .suffix in target_formats :
1919 try :
2020 result = md .convert (file_path )
2121 except Exception as e :
2222 print (f"✗ Error converting { file_path .name } : { e } " )
2323 continue
2424
25- output_file = (
26- output_path / f"{ file_path .stem } { file_path .suffix } .md"
27- )
25+ output_file = output_path / f"{ file_path .stem } { file_path .suffix } .md"
2826 output_file .write_text (result .markdown , encoding = "utf-8" )
2927 print (f"✓ Converted { file_path .name } → { output_file .name } " )
3028
Original file line number Diff line number Diff line change 11from markitdown import MarkItDown
22
33md = MarkItDown ()
4- result = md .convert ("./data/sample_DOCX .docx" )
5- print (result )
4+ result = md .convert ("./data/markdown_syntax .docx" )
5+ print (result . markdown )
Original file line number Diff line number Diff line change 22from openai import OpenAI
33
44client = OpenAI ()
5- md = MarkItDown (
6- llm_client = client ,
7- llm_model = "gpt-4o" ,
8- )
5+ md = MarkItDown (llm_client = client , llm_model = "gpt-4o" )
96
107result = md .convert ("./data/real-python.png" )
118print (result .markdown )
You can’t perform that action at this time.
0 commit comments