Read Markdown text from a file or stream and write HTML output to a file or stream. This is a shortcut function which initializes an instance of [`Markdown`][markdown.Markdown], and calls the [`convertFile`][markdown.Markdown.convertFile] method rather than [`convert`][markdown.Mar
(**kwargs: Any)
| 519 | |
| 520 | |
| 521 | def markdownFromFile(**kwargs: Any): |
| 522 | """ |
| 523 | Read Markdown text from a file or stream and write HTML output to a file or stream. |
| 524 | |
| 525 | This is a shortcut function which initializes an instance of [`Markdown`][markdown.Markdown], |
| 526 | and calls the [`convertFile`][markdown.Markdown.convertFile] method rather than |
| 527 | [`convert`][markdown.Markdown.convert]. |
| 528 | |
| 529 | Keyword arguments: |
| 530 | input (str | BinaryIO): A file name or readable object. |
| 531 | output (str | BinaryIO): A file name or writable object. |
| 532 | encoding (str): Encoding of input and output. |
| 533 | **kwargs: Any arguments accepted by the `Markdown` class. |
| 534 | |
| 535 | !!! warning |
| 536 | The Python-Markdown library does ***not*** sanitize its HTML output. |
| 537 | As `markdown.markdownFromFile` writes directly to the file system, there is no |
| 538 | easy way to sanitize the output from Python code. Therefore, it is |
| 539 | recommended that the `markdown.markdownFromFile` function not be used on input |
| 540 | from an untrusted source. For more information see [Sanitizing HTML |
| 541 | Output](../../sanitization.md). |
| 542 | |
| 543 | """ |
| 544 | md = Markdown(**kwargs) |
| 545 | md.convertFile(kwargs.get('input', None), |
| 546 | kwargs.get('output', None), |
| 547 | kwargs.get('encoding', None)) |
nothing calls this directly
no test coverage detected