QmdToPyConverter
converter.QmdToPyConverter(linter)
Convert lines from a .qmd file to .py file.
Attributes
| in_chunk_options |
bool |
True if currently at the start of a code chunk, parsing Quarto chunk options or leading blank lines. |
| in_python |
bool |
True if currently processing lines inside a Python code chunk. |
| py_lines |
list |
Stores the lines to be written to the output Python file. |
Methods
| convert |
Run converter on the provided lines. |
| process_line |
Process individual lines with state tracking. |
| reset |
Reset the state (except linter). |
convert
converter.QmdToPyConverter.convert(qmd_lines)
Run converter on the provided lines.
Parameters
| qmd_lines |
List[str] |
List containing each line from the Quarto file. |
required |
Returns
| py_lines |
List[str] |
List of each line for the output Python file. |
process_line
converter.QmdToPyConverter.process_line(original_line)
Process individual lines with state tracking.
Parameters
| original_line |
str |
Line to process. |
required |
reset
converter.QmdToPyConverter.reset()
Reset the state (except linter).