From 291dcdfd5fd04f67a0e3f0df88922ede1d27b46b Mon Sep 17 00:00:00 2001 From: Shawn Davis Date: Sat, 29 Jan 2022 20:47:56 -0600 Subject: [PATCH] Added support for explanations and screenshots. --- scripttease/lib/snippets/messages.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripttease/lib/snippets/messages.py b/scripttease/lib/snippets/messages.py index 65ad7c4..e75554e 100644 --- a/scripttease/lib/snippets/messages.py +++ b/scripttease/lib/snippets/messages.py @@ -7,6 +7,22 @@ messages = { 'clear;' ], 'echo': 'echo "{{ args[0] }}"', + 'explain': "{{ args[0] }}", + 'screenshot': [ + '{% if output == "md" %}', + "![{% if caption %}{{ caption }}]({{ args[0] }})", + '{% elif output == "rst" %}', + '.. figure:: {{ args[0] }}', + '{% if caption %}\n :alt: {{ caption }}{% endif %}', + '{% if height %}\n :height: {{ height }}{% endif %}', + '{% if width %}\n :width: {{ width }}{% endif %}' + '\n', + '{% else %}', + '{{ caption }}{% endif %}'
+        '{% if classes %} class={{ classes }}{% endif %}'
+        '{% if height %} height=', + '{% endif %}', + ], 'slack': [ "curl -X POST -H 'Content-type: application/json' --data", '{"text": "{{ args[0] }}"}',