Module markers

Module markers 

Source
Expand description

Marker constants and regex patterns for markdown-code-runner.

Constants§

CODE_COMMENT_BASH_START
Bash code comment start marker.
CODE_COMMENT_END
Code comment end marker.
CODE_COMMENT_PYTHON_START
Python code comment start marker.
OUTPUT_END
Output end marker.
OUTPUT_START
Output start marker.
SKIP
Skip marker to prevent code execution.
WARNING
Warning comment inserted in output sections.

Statics§

CODE_BACKTICKS_END_PATTERN
Pattern to match backtick code block end.
CODE_BACKTICKS_START_PATTERN
Pattern to match backtick code block start with markdown-code-runner.
CODE_COMMENT_BASH_START_PATTERN
Pattern to match Bash code comment start with optional leading whitespace.
CODE_COMMENT_END_PATTERN
Pattern to match code comment end with optional leading whitespace.
CODE_COMMENT_PYTHON_START_PATTERN
Pattern to match Python code comment start with optional leading whitespace.
OUTPUT_END_PATTERN
Pattern to match output end with optional leading whitespace.
OUTPUT_START_PATTERN
Pattern to match output start with optional leading whitespace.
SKIP_PATTERN
Pattern to match skip marker with optional leading whitespace.

Functions§

get_indent
Extract leading whitespace from a line.
is_code_backticks_end
Check if a line matches the backticks code block end marker.
is_code_backticks_start
Check if a line matches the backticks code block start marker.
is_code_comment_bash_start
Check if a line matches the Bash code comment start marker.
is_code_comment_end
Check if a line matches the code comment end marker.
is_code_comment_python_start
Check if a line matches the Python code comment start marker.
is_output_end
Check if a line matches the output end marker.
is_output_start
Check if a line matches the output start marker.
is_skip
Check if a line matches the skip marker.
md_comment
Format a string as a Markdown comment.
remove_md_comment
Remove Markdown comment tags from a string. Returns None if the string is not a valid Markdown comment.