From 56199dcd9d8c1c12ecefb687f11f8dc6ee69627d Mon Sep 17 00:00:00 2001 From: Fire Chicken Date: Mon, 31 Aug 2026 19:36:59 -0600 Subject: [PATCH 1/8] Add voice command for inserting table headers --- lang/markdown/markdown.py | 19 +++++++++++++++++++ lang/markdown/markdown.talon | 1 + 2 files changed, 20 insertions(+) diff --git a/lang/markdown/markdown.py b/lang/markdown/markdown.py index bee199824..8f5de1bcb 100644 --- a/lang/markdown/markdown.py +++ b/lang/markdown/markdown.py @@ -36,3 +36,22 @@ def markdown_wrap_selection_with_link(url: str): """Wraps the selection with a markdown link for the specified url""" description = actions.edit.selected_text() actions.user.markdown_insert_link(url, description) + + def markdown_insert_table_header(num_columns: int): + """Creates a table header with the given number of columns""" + if num_columns <= 0: + return + # build a snippet + # add the places to put the column names + snippet_body_parts = ["|"] + for i in range(num_columns): + snippet_body_parts.append(f" ${i+1} |") + # add the dashed lines + snippet_body_parts.append("\n|") + for i in range(num_columns): + snippet_body_parts.append(f"---|") + # put it all together + snippet_body = "".join(snippet_body_parts) + # directly insert the snippet body. + # Because the number of placeholders varies, we could not do this in a .snippet file. + actions.user.insert_snippet(snippet_body) \ No newline at end of file diff --git a/lang/markdown/markdown.talon b/lang/markdown/markdown.talon index d297416bf..54074fac3 100644 --- a/lang/markdown/markdown.talon +++ b/lang/markdown/markdown.talon @@ -45,3 +45,4 @@ list six: link: user.insert_snippet_by_name("link") link clip: user.markdown_insert_link(clip.text()) link wrap clip: user.markdown_wrap_selection_with_link(clip.text()) +table header : user.markdown_insert_table_header(number_small) \ No newline at end of file From d1abda870cbe52796cd5c656b06d490ebce4f00e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2026 01:39:21 +0000 Subject: [PATCH 2/8] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- lang/markdown/markdown.py | 10 +++++----- lang/markdown/markdown.talon | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lang/markdown/markdown.py b/lang/markdown/markdown.py index 8f5de1bcb..b3b26ed8b 100644 --- a/lang/markdown/markdown.py +++ b/lang/markdown/markdown.py @@ -40,18 +40,18 @@ def markdown_wrap_selection_with_link(url: str): def markdown_insert_table_header(num_columns: int): """Creates a table header with the given number of columns""" if num_columns <= 0: - return + return # build a snippet # add the places to put the column names snippet_body_parts = ["|"] for i in range(num_columns): - snippet_body_parts.append(f" ${i+1} |") + snippet_body_parts.append(f" ${i + 1} |") # add the dashed lines snippet_body_parts.append("\n|") for i in range(num_columns): - snippet_body_parts.append(f"---|") + snippet_body_parts.append("---|") # put it all together snippet_body = "".join(snippet_body_parts) - # directly insert the snippet body. + # directly insert the snippet body. # Because the number of placeholders varies, we could not do this in a .snippet file. - actions.user.insert_snippet(snippet_body) \ No newline at end of file + actions.user.insert_snippet(snippet_body) diff --git a/lang/markdown/markdown.talon b/lang/markdown/markdown.talon index 54074fac3..e378286d3 100644 --- a/lang/markdown/markdown.talon +++ b/lang/markdown/markdown.talon @@ -45,4 +45,4 @@ list six: link: user.insert_snippet_by_name("link") link clip: user.markdown_insert_link(clip.text()) link wrap clip: user.markdown_wrap_selection_with_link(clip.text()) -table header : user.markdown_insert_table_header(number_small) \ No newline at end of file +table header : user.markdown_insert_table_header(number_small) From b479bec0c1a6e3a00e12ee44c14fa4d652778b49 Mon Sep 17 00:00:00 2001 From: Fire Chicken Date: Mon, 31 Aug 2026 19:41:51 -0600 Subject: [PATCH 3/8] Add test table --- PRACTICES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PRACTICES.md b/PRACTICES.md index d8323b94c..5a349780a 100644 --- a/PRACTICES.md +++ b/PRACTICES.md @@ -140,3 +140,7 @@ Our voice commands using the clipboard usually have `paste` or `clip` in their s - Keep the "new user message" description consistent with new UI. Update the description if you have a good reason to not follow the patterns it documents. - If your imgui window is too tall for some screens, consider using pagination buttons like the help system. - Try to avoid having multiple spoken forms for the same button. If you must, show alternatives using TalonScript syntax (e.g. `(foo | bar) [baz]`). + +| Temporary Table | for testing purposes | +|---|---| +| this is an entry | more text | \ No newline at end of file From 7a3b88a2658ad2fd6255aee1542e359d414894bc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2026 01:42:05 +0000 Subject: [PATCH 4/8] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- PRACTICES.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PRACTICES.md b/PRACTICES.md index 5a349780a..d19ea0e2c 100644 --- a/PRACTICES.md +++ b/PRACTICES.md @@ -141,6 +141,6 @@ Our voice commands using the clipboard usually have `paste` or `clip` in their s - If your imgui window is too tall for some screens, consider using pagination buttons like the help system. - Try to avoid having multiple spoken forms for the same button. If you must, show alternatives using TalonScript syntax (e.g. `(foo | bar) [baz]`). -| Temporary Table | for testing purposes | -|---|---| -| this is an entry | more text | \ No newline at end of file +| Temporary Table | for testing purposes | +| ---------------- | -------------------- | +| this is an entry | more text | From ab0661003458bbfce23a23c37742f0fbdf1be9d9 Mon Sep 17 00:00:00 2001 From: Fire Chicken Date: Mon, 31 Aug 2026 19:42:51 -0600 Subject: [PATCH 5/8] Remove testing table --- PRACTICES.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/PRACTICES.md b/PRACTICES.md index d19ea0e2c..d8323b94c 100644 --- a/PRACTICES.md +++ b/PRACTICES.md @@ -140,7 +140,3 @@ Our voice commands using the clipboard usually have `paste` or `clip` in their s - Keep the "new user message" description consistent with new UI. Update the description if you have a good reason to not follow the patterns it documents. - If your imgui window is too tall for some screens, consider using pagination buttons like the help system. - Try to avoid having multiple spoken forms for the same button. If you must, show alternatives using TalonScript syntax (e.g. `(foo | bar) [baz]`). - -| Temporary Table | for testing purposes | -| ---------------- | -------------------- | -| this is an entry | more text | From 3cf7d18780017541e7b977c6c6e7029c0decb5d5 Mon Sep 17 00:00:00 2001 From: Fire Chicken Date: Mon, 31 Aug 2026 19:44:41 -0600 Subject: [PATCH 6/8] Simplify code --- lang/markdown/markdown.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lang/markdown/markdown.py b/lang/markdown/markdown.py index b3b26ed8b..d5406c8e9 100644 --- a/lang/markdown/markdown.py +++ b/lang/markdown/markdown.py @@ -48,8 +48,7 @@ def markdown_insert_table_header(num_columns: int): snippet_body_parts.append(f" ${i + 1} |") # add the dashed lines snippet_body_parts.append("\n|") - for i in range(num_columns): - snippet_body_parts.append("---|") + snippet_body_parts.append("---|"*num_columns) # put it all together snippet_body = "".join(snippet_body_parts) # directly insert the snippet body. From 545ee4df878c181231386bdfba56ca7c0be2d6b5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2026 01:44:54 +0000 Subject: [PATCH 7/8] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- lang/markdown/markdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/markdown/markdown.py b/lang/markdown/markdown.py index d5406c8e9..c77369dc3 100644 --- a/lang/markdown/markdown.py +++ b/lang/markdown/markdown.py @@ -48,7 +48,7 @@ def markdown_insert_table_header(num_columns: int): snippet_body_parts.append(f" ${i + 1} |") # add the dashed lines snippet_body_parts.append("\n|") - snippet_body_parts.append("---|"*num_columns) + snippet_body_parts.append("---|" * num_columns) # put it all together snippet_body = "".join(snippet_body_parts) # directly insert the snippet body. From 8525612ce6abc292c91640e9edf1f6ee610dcebd Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 5 Sep 2026 19:00:03 +0200 Subject: [PATCH 8/8] !Update lang/markdown/markdown.py --- lang/markdown/markdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/markdown/markdown.py b/lang/markdown/markdown.py index c77369dc3..b049c6227 100644 --- a/lang/markdown/markdown.py +++ b/lang/markdown/markdown.py @@ -40,7 +40,7 @@ def markdown_wrap_selection_with_link(url: str): def markdown_insert_table_header(num_columns: int): """Creates a table header with the given number of columns""" if num_columns <= 0: - return + raise ValueError("Can't insert table header with 0 columns.") # build a snippet # add the places to put the column names snippet_body_parts = ["|"]