diff --git a/README.md b/README.md index 7e6f72b..8a2235f 100644 --- a/README.md +++ b/README.md @@ -103,10 +103,16 @@ MarkItDown also supports converting file objects directly: from markitdown import MarkItDown md = MarkItDown() -path = "test.docx" -with open(path, 'rb') as file: + +# Binary Mode +with open("test.docx", 'rb') as file: result = md.convert(file, file_extension=".docx") print(result.text_content) + +# Non-Binary Mode +with open("sample.ipynb", 'rt', encoding="utf-8") as file: + result = md.convert(file, file_extension=".ipynb") + print(result.text_content) ``` To use Large Language Models for image descriptions, provide `llm_client` and `llm_model`: