MCPcopy Create free account
hub / github.com/executablebooks/markdown-it-py / convert_file

Function convert_file

markdown_it/cli/parse.py:48–58  ·  view source on GitHub ↗

Parse a Markdown file and dump the output to stdout.

(filename: str)

Source from the content-addressed store, hash-verified

46
47
48def convert_file(filename: str) -> None:
49 """
50 Parse a Markdown file and dump the output to stdout.
51 """
52 try:
53 with open(filename, encoding="utf8", errors="ignore") as fin:
54 rendered = MarkdownIt().render(fin.read())
55 print(rendered, end="")
56 except OSError:
57 sys.stderr.write(f'Cannot open file "{filename}".\n')
58 sys.exit(1)
59
60
61def interactive() -> None:

Callers 1

convertFunction · 0.85

Calls 2

MarkdownItClass · 0.90
renderMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…