MCPcopy
hub / github.com/pingcap/docs-cn / replace_heading_func

Function replace_heading_func

scripts/merge_by_toc.py:184–193  ·  view source on GitHub ↗
(diff_level=0)

Source from the content-addressed store, hash-verified

182 return hyper_link_pattern.sub(replace_link, chapter)
183
184def replace_heading_func(diff_level=0):
185
186 def replace_heading(match):
187 if diff_level == 0:
188 return match.group(0)
189 else:
190 return '\n' + '#' * (match.group(0).count('#') + diff_level) + ' '
191
192
193 return replace_heading
194
195# remove <StickyHeaderTable> / </StickyHeaderTable> tags for PDF output
196sticky_header_table_pattern = re.compile(r'^\s*</?StickyHeaderTable\s*/?>\s*$')

Callers 1

merge_by_toc.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected