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

Method to_html

utils/src/presentation.py:929–957  ·  view source on GitHub ↗

Convert the table data to HTML, ensuring each row and cell is represented.

(self, style_args: StyleArg)

Source from the content-addressed store, hash-verified

927 return table_shape
928
929 def to_html(self, style_args: StyleArg) -> str:
930 """
931 Convert the table data to HTML, ensuring each row and cell is represented.
932 """
933 # If there’s no content at all, return ""
934 if not self.data["content"]:
935 return ""
936
937 rows_html = []
938 for row_cells in self.data["content"]:
939 # If a row is empty, skip it (or handle however you like)
940 if not row_cells:
941 continue
942
943 # Build each cell
944 cells_html = "".join(
945 f"<td>{(cell_text or '').strip()}</td>"
946 for cell_text in row_cells
947 )
948 rows_html.append(f"<tr>{cells_html}</tr>")
949
950 # If after filtering empty rows we have nothing, return empty
951 if not rows_html:
952 return ""
953
954 table_html = f"{self.indent}<table{self.get_inline_style(style_args)}>\n"
955 table_html += "\n".join(rows_html)
956 table_html += f"\n{self.indent}</table>\n"
957 return table_html
958
959
960class SlidePage:

Callers 10

to_htmlMethod · 0.45
to_htmlMethod · 0.45
to_htmlMethod · 0.45
to_htmlMethod · 0.45
to_htmlMethod · 0.45
presentation.pyFile · 0.45
content_inductMethod · 0.45
synergizeMethod · 0.45
synergizeMethod · 0.45
synergizeMethod · 0.45

Calls 1

get_inline_styleMethod · 0.45

Tested by

no test coverage detected