Converts the loaded document to Markdown using default options and returns the result with the Markdown content in ConvertResult.content.
defconvert(self):...
Returns: A ConvertResult whose ConvertResult.is_success indicates whether the conversion succeeded. On success, ConvertResult.content contains the Markdown string.
convert
Converts the loaded document to Markdown and writes the output to the specified stream.
The ConvertResult.content property will be None; the Markdown bytes are written directly to output_stream.
defconvert(self,output_stream):...
Parameter
Type
Description
output_stream
io.RawIOBase
A writable stream that will receive the UTF-8 encoded Markdown output.
Returns: ConvertResult: A ConvertResult indicating success or failure. On success, ConvertResult.content is None because the output was written to the stream.
convert
Converts the loaded document to Markdown and saves the result to a file at the specified output_file_path.
defconvert(self,output_file_path):...
Parameter
Type
Description
output_file_path
str
The path where the Markdown file will be written.
Returns: ConvertResult: A ConvertResult indicating success or failure. On success, ConvertResult.Content is None because the output was written to the file.
convert
Converts the loaded document to Markdown with the specified options and returns the result with the Markdown content in ConvertResult.content.
defconvert(self,convert_options):...
Parameter
Type
Description
convert_options
ConvertOptions
Options that control the conversion, such as ConvertOptions.heading_level_offset, ConvertOptions.image_export_strategy, and ConvertOptions.page_numbers. Pass None to use defaults.
Returns: A ConvertResult whose ConvertResult.content contains the Markdown string on success.
convert
Converts the loaded document to Markdown with the specified options, writing the output to a stream.