MCPcopy Index your code
hub / github.com/SourceCode-AI/aura / generate_heading

Method generate_heading

aura/output/text.py:105–112  ·  view source on GitHub ↗
(self, text, left="\u251C", right="\u2524", infill="\u2591", width=None)

Source from the content-addressed store, hash-verified

103 self.print_separator(left="\u2558", sep="\u2550", right="\u255B", **kwargs)
104
105 def generate_heading(self, text, left="\u251C", right="\u2524", infill="\u2591", width=None):
106 if width is None:
107 width = self.width - len(left) - len(right) - 2
108
109 text_len = self.ansi_length(text)
110 ljust = (width - text_len) // 2
111 rjust = width - text_len - ljust
112 return f"{left}{infill*ljust} {text} {infill*rjust}{right}"
113
114 def print_heading(self, *args, **kwargs):
115 secho(self.generate_heading(*args, **kwargs), file=self.fd, color=TTY_COLORS)

Callers 2

print_headingMethod · 0.95
print_tablesMethod · 0.95

Calls 1

ansi_lengthMethod · 0.95

Tested by

no test coverage detected