MCPcopy Create free account
hub / github.com/apache/datafusion / _process_code_block

Function _process_code_block

docs/rustdoc_trim.py:30–42  ·  view source on GitHub ↗
(match)

Source from the content-addressed store, hash-verified

28 """
29
30 def _process_code_block(match):
31 # Extract the code block content
32 code_block_content = match.group(1).strip()
33
34 # Remove lines starting with '#'
35 modified_code_block = "\n".join(
36 line
37 for line in code_block_content.splitlines()
38 if (not line.lstrip().startswith("# ")) and line.strip() != "#"
39 )
40
41 # Return the modified code block wrapped in triple backticks
42 return f"```rust\n{modified_code_block}\n```"
43
44 # Replace all Rust code blocks using the _process_code_block function
45 return RUST_CODE_BLOCK_PATTERN.sub(_process_code_block, markdown_content)

Callers

nothing calls this directly

Calls 2

groupMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…