MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / add_code

Method add_code

src/__init__.py:2178–2187  ·  view source on GitHub ↗

Add a "code" tag

(self, text=None)

Source from the content-addressed store, hash-verified

2176 return self
2177
2178 def add_code(self, text=None):
2179 """Add a "code" tag"""
2180 child = self.create_element("code")
2181 if type(text) is str:
2182 child.append_child(self.create_text_node(text))
2183 prev = self.span_bottom()
2184 if prev is None:
2185 prev = self
2186 prev.append_child(child)
2187 return self
2188
2189 def add_codeblock(self):
2190 """Add monospaced lines ("pre" node)"""

Callers

nothing calls this directly

Calls 4

create_elementMethod · 0.95
create_text_nodeMethod · 0.95
span_bottomMethod · 0.95
append_childMethod · 0.80

Tested by

no test coverage detected