MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / to_html

Method to_html

utils/src/presentation.py:91–102  ·  view source on GitHub ↗
(self, style_args: StyleArg)

Source from the content-addressed store, hash-verified

89 self.text = re.sub(r"(_x000B_|\\x0b)", " ", paragraph.text)
90
91 def to_html(self, style_args: StyleArg):
92 if self.idx == -1:
93 raise ValueError(f"paragraph {self.idx} is not valid")
94 tag = "li" if self.bullet else "p"
95 id_str = f" id='{self.idx}'" if style_args.paragraph_id else ""
96 font_style = get_font_style(self.font)
97 style_str = (
98 f" style='{font_style}'" if style_args.font_style and font_style else ""
99 )
100 if self.bullet:
101 style_str += f" bullet-type='{self.bullet}'"
102 return f"<{tag}{id_str}{style_str}>{self.text}</{tag}>"
103
104 def __repr__(self):
105 return f"Paragraph-{self.idx}: {self.text}"

Callers

nothing calls this directly

Calls 1

get_font_styleFunction · 0.90

Tested by

no test coverage detected