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

Function interactive

markdown_it/cli/parse.py:61–79  ·  view source on GitHub ↗

Parse user input, dump to stdout, rinse and repeat. Python REPL style.

()

Source from the content-addressed store, hash-verified

59
60
61def interactive() -> None:
62 """
63 Parse user input, dump to stdout, rinse and repeat.
64 Python REPL style.
65 """
66 print_heading()
67 contents = []
68 more = False
69 while True:
70 try:
71 prompt, more = ("... ", True) if more else (">>> ", True)
72 contents.append(input(prompt) + "\n")
73 except EOFError:
74 print("\n" + MarkdownIt().render("\n".join(contents)), end="")
75 more = False
76 contents = []
77 except KeyboardInterrupt:
78 print("\nExiting.")
79 break
80
81
82def parse_args(args: Sequence[str] | None) -> argparse.Namespace:

Callers 1

mainFunction · 0.85

Calls 3

MarkdownItClass · 0.90
print_headingFunction · 0.85
renderMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…