From 8d74680724cc696ef34351091cb4267c954f31ee Mon Sep 17 00:00:00 2001 From: Yottacle Date: Fri, 17 Apr 2026 16:07:09 +0200 Subject: [PATCH] Added templates for tables and highlight, strike and textStyle marks --- tiptapy/templates/marks/highlight.html | 1 + tiptapy/templates/marks/strike.html | 1 + tiptapy/templates/marks/textStyle.html | 6 ++++++ tiptapy/templates/table.html | 16 ++++++++++++++++ tiptapy/templates/tableCell.html | 7 +++++++ tiptapy/templates/tableHeader.html | 7 +++++++ tiptapy/templates/tableRow.html | 7 +++++++ 7 files changed, 45 insertions(+) create mode 100644 tiptapy/templates/marks/highlight.html create mode 100644 tiptapy/templates/marks/strike.html create mode 100755 tiptapy/templates/marks/textStyle.html create mode 100644 tiptapy/templates/table.html create mode 100644 tiptapy/templates/tableCell.html create mode 100644 tiptapy/templates/tableHeader.html create mode 100644 tiptapy/templates/tableRow.html diff --git a/tiptapy/templates/marks/highlight.html b/tiptapy/templates/marks/highlight.html new file mode 100644 index 0000000..e9475d1 --- /dev/null +++ b/tiptapy/templates/marks/highlight.html @@ -0,0 +1 @@ +{{text}} \ No newline at end of file diff --git a/tiptapy/templates/marks/strike.html b/tiptapy/templates/marks/strike.html new file mode 100644 index 0000000..674f38d --- /dev/null +++ b/tiptapy/templates/marks/strike.html @@ -0,0 +1 @@ +{{text}} \ No newline at end of file diff --git a/tiptapy/templates/marks/textStyle.html b/tiptapy/templates/marks/textStyle.html new file mode 100755 index 0000000..b462e47 --- /dev/null +++ b/tiptapy/templates/marks/textStyle.html @@ -0,0 +1,6 @@ +{%- set attr_s = mark.attrs.get("textClass") -%} +{%- if attr_s -%} +{{ text }} +{%- else -%} +{{ text }} +{%- endif -%} \ No newline at end of file diff --git a/tiptapy/templates/table.html b/tiptapy/templates/table.html new file mode 100644 index 0000000..0eb7920 --- /dev/null +++ b/tiptapy/templates/table.html @@ -0,0 +1,16 @@ + + {%- for item in node.content if item.content[0].type == "tableHeader" -%} + + {%- with template=item.type + '.html', node=item -%} + {%- include template -%} + {%- endwith -%} + + {%- endfor -%} + + {%- for item in node.content if item.content[0].type != "tableHeader" -%} + {%- with template=item.type + '.html', node=item -%} + {%- include template -%} + {%- endwith -%} + {%- endfor -%} + + \ No newline at end of file diff --git a/tiptapy/templates/tableCell.html b/tiptapy/templates/tableCell.html new file mode 100644 index 0000000..5f777be --- /dev/null +++ b/tiptapy/templates/tableCell.html @@ -0,0 +1,7 @@ + + {%- for item in node.content -%} + {%- with template=item.type + '.html', node=item -%} + {%- include template -%} + {%- endwith -%} + {%- endfor -%} + diff --git a/tiptapy/templates/tableHeader.html b/tiptapy/templates/tableHeader.html new file mode 100644 index 0000000..a5cde9a --- /dev/null +++ b/tiptapy/templates/tableHeader.html @@ -0,0 +1,7 @@ + + {%- for item in node.content -%} + {%- with template=item.type + '.html', node=item -%} + {%- include template -%} + {%- endwith -%} + {%- endfor -%} + diff --git a/tiptapy/templates/tableRow.html b/tiptapy/templates/tableRow.html new file mode 100644 index 0000000..cee1d8f --- /dev/null +++ b/tiptapy/templates/tableRow.html @@ -0,0 +1,7 @@ + + {%- for item in node.content -%} + {%- with template=item.type + '.html', node=item -%} + {%- include template -%} + {%- endwith -%} + {%- endfor -%} +